Questions tagged as 'python'

0
answers

Django Rest Framework - Allowing blanks in a CharField

I have the following model, which in its attribute name I want to allow compound names or blank spaces, for example Real Madrid class Team(models.Model): name = models.CharField( _('name'), max_length=30,...
asked by 03.05.2017 / 03:13
1
answer

About the pyjstat library for json

I'm trying to read a json with pyjstat but it gives me an error:    KeyError: 'dimension' This is the code: from pyjstat import pyjstat EXAMPLE_URL ='http://www.cso.ie/StatbankServices/StatbankServices.svc/jsonservice/responseinstance/...
asked by 11.04.2017 / 16:40
1
answer

Calculate quarterly statistics django

I have to show different statistics in a project in django, so far it works well, when I calculate them, but I need to make quarterly cuts, how could I do it? I leave you the view.py def inicio(request): plan_gral = jovenclub.objects.aggre...
asked by 16.04.2017 / 17:49
0
answers

Massive insertions in MongoDB with Python

I'm using python + MongoDB with pymongo So far everything is fine but now I would like to optimize the insert, what I do is read a csv with 50000 rows and create a loop to read row by row, going to json and insert (insert), it takes a long ti...
asked by 16.04.2017 / 21:24
1
answer

How to Show With Tkinter The Result of Subprocess.call?

Good morning I would like to know how to use Tkinter , I can show on the screen the result of the module subprocess.call(["free","-m"]) . Thank you very much for your attention.     
asked by 09.04.2017 / 20:19
1
answer

Error working with Kivy: NameError: name 'ListProperty' is not defined

I have an error in a program that I am trying to pass to Kivy. I have a function: askquestions(self,indexquestionlist) which, as seen, requires the indexquestionlist parameter. This parameter is the return produced by another funct...
asked by 22.04.2017 / 04:43
1
answer

Problems with xrange Python

Hello again everyone, It turns out that I installed a library to call some functions, but those functions use the xrange function and for some reason Python does not recognize it ... The error is as follows: Traceback (most recent call l...
asked by 06.04.2017 / 21:43
1
answer

Save an array as a .csv file in Python

I'm going to generate a 3000 x 14 matrix in Python and then I want to save it in a file, I'm using the command: import numpy as np tabla = np.random.random((3000,14)) np.savetxt('tabla.dat', tabla) This works well. The reason that brings...
asked by 06.04.2017 / 16:12
2
answers

create exe with pyinstaller including subfolders

I have a project made in Python 3.4. I want to make the executable including the sub-folders that the project has, but when executing: pyinstaller --noconsole main.py do not add these subfolders     
asked by 03.04.2017 / 07:40
1
answer

Join two dictionaries from text files in which each row is the representation of a dictionary

I have two text files each with about 10 lines of content in dictionary format each:    {'ID': '30', 'Name': 'ECONOMY I', 'Code': 'COFI-214'}   {'ID': '30', 'Name': 'ECONOMY II', 'Code': 'COFI-215'}   ... I want to create a new file tha...
asked by 24.04.2017 / 20:09