Questions tagged as 'python-2.x'

2
answers

Replace commas with points in a dataframe (comma as decimal separator)

I'm new to pandas and I have a question about changing points by commas in Python 2. The numbers in the csv are presented this way: As you can see in the image, the floats have different number of decimals. First I tried to change...
asked by 22.07.2018 / 06:07
3
answers

Arguments sys.argv [1] .split () as string?

I'm stuck in a script. I try to expose you to see if you can help me. I define the following before entering the loop. cliente, fecha, hora, state, nombre, result, most_repeated = sys.argv[1].split() timestamp = str(fecha)+' '+' '+str(hora...
asked by 09.01.2018 / 10:16
2
answers

Delete item from a list in python

I do not know what I'm wrong about, I have the concept but it confuses me a bit def eliminarEnLista(L): n=int(raw_input("Ingrese el numero que desea eliminar de la lista: ")) L=[] i=0 while i <len(L): for c...
asked by 21.10.2018 / 02:15
1
answer

Pandas, selec_index.loc [] same sentence, different results when printing

I do not understand why I get so disparate results presentations with these two sentences that, in principle, are the same (ini = 0 in the script): >>> print (selec_index.loc[0, "Fecha"]) 2017-09-12 00:00:00 >>> print ("Fech...
asked by 12.11.2017 / 21:00
1
answer

How to play videos with the Python IO library?

I would like to play a video that I get from an ftp server, at this moment the file is being saved on the server but I do not want it to be saved but to be played immediately. They told me that with the library io it can be done but I would l...
asked by 04.04.2017 / 23:11
1
answer

When filling in a python dictionary in for me, repeat the last value in the other items

I have a dictionary that I want to fill with two lists, one that has the key and another that has the values, when it is with the for to save each item it is removed in order and saves them, but at the time of printing the dictionary I see that...
asked by 11.10.2017 / 18:58
0
answers

Migration Django 1.10 a 1.11 Error environment can only contain strings

Recently I actulize django from its version 1.10 to 1.11 and the console sends me the following error Traceback (most recent call last): File "manage.py", line 10, in <module> execute_from_command_line(sys.argv) File "C:\User...
asked by 12.05.2017 / 15:38
1
answer

Problems with menu in python

This is what I have def Menu(): #Muestra en pantalla la imagen guardada en Ganag screen.blit(Menug, (0,0)) #Actualizará el contenido de la pantalla entera for event in pygame.event.get(): dificultad =0 if event.type ==...
asked by 10.10.2018 / 05:24
2
answers

Determine if a number of two digits belongs to the fibonacci series

I need to determine if a two-digit number belongs to the fibonacci series, I have the following code: '''Leer un número de dos dígitos y determinar si pertenece a la serie de Fibonacci. Con ciclos.''' numero1 = int(raw_input("Digite un numero...
asked by 29.08.2018 / 03:10
2
answers

Can you return a print or a message in python?

If in a function I can return a print or the message itself that they ask me to give, the exercise says that if the number is inside the list it must tell the user that such a value is in the list and the same in case opposite. def comprobarEn...
asked by 21.10.2018 / 01:35