Questions tagged as 'python'

1
answer

Using close in Python

Why is it necessary to close ( close ) a file ( file ) open ( open ) in Python? What would happen if you left the file open?     
asked by 17.02.2018 / 23:38
1
answer

The program skips the IF and goes straight to the ELSE [closed]

I'm practicing the exceptions in python and I have a problem, the exceptions are captured well but then the program does not work correctly. #Utilizamos este metedo para importar las funciones del archivo from Funciones import llegadaCamion,nu...
asked by 16.05.2018 / 13:42
3
answers

Multiply matrices in python

This is a question a bit simple but I can not solve it on my own, and I have not found any post related to this topic, my question is this: matriz=[[1,1,1],[1,1,1],[1,1,1]] print(matriz) matriz[0]=matriz[0]*2 print(matriz) What I want to...
asked by 21.05.2018 / 22:37
2
answers

compare from a list in python

I have a list which greetings saludo = ['bien', 'genial'] What I am trying to do is that depending on the answer I get an argument, example: if saludo[] == 'bien': print('Me alegro') else: print('Que bueno que estes genial') The proble...
asked by 19.01.2018 / 20:56
2
answers

"conda" is not recognized as an internal or external command, program or batch file executable

I am installing tensor flow for python 3.6. I'm installing it with the Anaconda method ( link ) when trying to execute this command: C:> conda create -n tensorflow python=3.5 I get this error: "conda" no se reconoce como un comando in...
asked by 15.12.2017 / 00:10
2
answers

Change date format ymd_hms to ymd

I have a dataframe in Python with two columns: StartTime and StopTime . In one of the operations, I need to group the data per day ( StartTime ). For this I need to eliminate hours, minutes, seconds from that col...
asked by 22.06.2017 / 12:45
1
answer

Delete a file with all its contents in Python

I would like to delete a directory that contains several files inside. It has the following structure: carpeta fichero1.txt fichero2.txt I tried to delete it directly with os.removedirs('carpeta') but it gives me the error...
asked by 20.09.2017 / 22:30
1
answer

Program that calculates the average and varianca gives different results with the calculator?

I have two NumPy arrays called follow_dismiss_i and follow_dismiss_display_i that contain a first column that contains counters and a second column that are indexes. I have created a program that helps me calculate: The res...
asked by 30.05.2017 / 16:39
1
answer

multiple statistics on django

I have to calculate a series of data for my project, it works 100% when it comes to general calculation, but when I try to take those same calculations to the facilities ( jovenclubs ) separately it returns me a list with all the values it...
asked by 21.04.2017 / 19:23
2
answers

Instance of an object in python

from Tree import Node q = Node(p) The problem with the code is that I get this message:    'Node' is not callable   This inspection highlights attempts to call objects which are not callable, like, for example, tuples. This does not le...
asked by 22.07.2017 / 01:14