Data dodania Pytanie
2017-03-11 07:03 Regex add character to matched string »
I have a long string which is a paragraph, however there is no white space after periods. For example: para = "I saw this film about 20 years ago and...
(5) odpowiedzi
2017-03-11 07:03 (Django) Does MySQL foreign key cascade delete parent or children first »
Currently, I am using Django with a MySQL backend database. Let us having the following database schema class Parent(models.Model): parent_id ...
(1) odpowiedzi
2017-03-11 02:03 Python inconsistent error when comparing two very large numbers »
I am fairly new to python and I'm writing a secure ftp server/client to handle basic uploading/downloading of files (but encrypted). To ensure the cl...
(1) odpowiedzi
2017-03-10 21:03 Preserve the order of symbols in sympy equation »
I would like to preserve the structure of equation in the following order. *Note that this is in sympy. Eq=A*X+B*U where X,U is assigned to other e...
(1) odpowiedzi
2017-03-10 19:03 How in Django/Python can I ensure safety from WYSIWYG-entered HTML? »
I would like to remove vulnerabilities to XSS / JavaScript injection in a web application where users are allowed to use an editor like CKEditor which...
(1) odpowiedzi
2017-03-10 16:03 How to determine row equality across several rows in a fully vectorized way? »
I have a numpy.ndarray called grouping of size (S, N). Each row of grouping gives me the group labels of a sample of data. I run my algorithm S times ...
(3) odpowiedzi
2017-03-10 16:03 Flask Admin on postgres database view »
Is there a way I can create admin view on Flask-Admin on a database view? I'm using Postgres, and have created a view, let's take the below one as exa...
(3) odpowiedzi
2017-03-10 13:03 Increase Version number if Travis at github was successfull »
I wrote a simple script in Python. Now I would like travis to check my code. After travis was successful, the version number should get increased. U...
(3) odpowiedzi
2017-03-10 12:03 TypeError at /app/profile/ , 'list' object is not callable handle_pageBegin args=() »
I want a button to create a PDF file (with Python 2.7, Django 1.8), but I have no clue how to express that to the machine. I started by reading some ...
(2) odpowiedzi
2017-03-10 10:03 Turn a file content into a binary array »
File content: 40 13 123 89 123 2223 4 12 0 I need to store the whole .txt file as a binary array to later be sent to server for processing. I kn...
(4) odpowiedzi
2017-03-09 20:03 Django logic and where to put it? »
I am new to Django, but I recently created my first application. I am wondering if I put my logic in the wrong places. From the Django book, I got tha...
(4) odpowiedzi
2017-03-09 16:03 Why is bokeh so much slower than matplotlib »
I plotted a box plot in Bokeh and another in matplotlib. Plotting in Bokeh was about 100 times slower for the same data. Why does Bokeh take so long? ...
(1) odpowiedzi
2017-03-09 14:03 do something when terminate a python program »
I want make a python script do something such as publishing a message before terminating it. I have tried signal and it works when I input Ctrl+c in c...
(1) odpowiedzi
2017-03-09 14:03 Why is Unicorn/Gunicorn slow to serve static content? »
I have read here that the Unicorn/Gunicorn HTTP server is 'not very good at serving static files', and that Nginx is better at serving static content....
(1) odpowiedzi
2017-03-09 12:03 Getting same instance with filter and filter_by using different ID strings »
query 1 style_id = u'373401' self.session.query(ChromeYearMakeModelStyle).\ filter_by(chromestyle_id=style_id).one() ChromeYearMakeModelStyle(3...
(1) odpowiedzi
2017-03-09 11:03 Sum values of similar keys inside two nested dictionary in python »
I have nested dictionary like this: data = { "2010":{ 'A':2, 'B':3, 'C':5, 'D':-18, }, ...
(4) odpowiedzi
2017-03-09 10:03 Row Sum of a dot product for huge matrix in python »
I have 2 matrix 100kx200 and 200x100k if they were small matrix I would just use numpy dot product sum(a.dot(b), axis = 0) however the matrix is t...
(3) odpowiedzi
2017-03-09 07:03 Django upload form, additional field causing error »
There is an issue I'm facing. I need to upload an excel of students containing their related data. I also need to have, as an user-input, the batch of...
(1) odpowiedzi
2017-03-09 06:03 python facebook api login »
This website http://wwwhousemag.com.br/vote use facebook api to get some data, i'm trying to authenticate with facebook using mechanize but i'm gettin...
(0) odpowiedzi
2017-03-09 05:03 Arranging columns in a pandas DataFrame »
I am currently working on a dataframe from a cross-tab operation. pd.crosstab(data['One'],data['two'], margins=True).apply(lambda r: r/len(data)*100,...
(3) odpowiedzi
2017-03-08 23:03 Python/Pandas: How to Match List of Strings with a DataFrame column »
I want to compare two columnn -- Description and Employer. I want to see if any keywords in Employer are found in the Description column. I have broke...
(4) odpowiedzi
2017-03-08 23:03 Django Form Field not showing up »
I just started learning Django and for this project I'm following the "Tango with Django" tutorial book. I have a problem with the input field of a fo...
(1) odpowiedzi
2017-03-08 21:03 What is a good way to integrate RSpec with another language such as Python or C#? »
I wrote a Ruby Gem and other teams in the business will need to implement the same functionality in Python and C#. I would like to run the exiting sp...
(1) odpowiedzi
2017-03-08 18:03 How to make logic based on `unicode` compatible with python2-3 »
I want to make this code compatible with python2-3 : def normalize_text(text, ignore_characters=''): if type(ignore_characters) not in [list, st...
(1) odpowiedzi
2017-03-08 17:03 Algorithm with Scrypt and PBKDF2 - Python »
I have tried to reproduce this algorithm on Python (Double pipes mean to add 0x1 or 0x2 to the passphrase) s1 = scrypt(key=(passphrase||0x1), salt=(...
(1) odpowiedzi
2017-03-08 16:03 django models use multiple foreign keys vs integerfield »
I have a situation where I have multiple foreign keys in one table to other tables (a parent and a non related field. I have to come to find that if ...
(0) odpowiedzi
2017-03-08 14:03 Are there any use cases for raise foo, bar in Python? »
Python 2 supports the following syntax for raise: raise FooException(bar) # call raise FooException, bar # positional I thought that the positional...
(1) odpowiedzi
2017-03-08 14:03 Replacing nested for loops and value assignment for list comprehension »
I've written a function to count the occurences of certain characters (A, C, G and T) within multiple strings at the same position and save the number...
(4) odpowiedzi
2017-03-08 14:03 Efficient way to add values to panda slices »
I would like to add values to pandas slices in an efficient way, since this function is called very often. The structure looks like this: import pand...
(1) odpowiedzi
2017-03-08 11:03 How can I get session in forms? »
I have a multistep form with checkboxes, after the user submit the first step form I save the objects he checked on his session, at the second step fo...
(1) odpowiedzi
2017-03-08 09:03 Loading a trained Keras model and continue training »
I was wondering if it was possible to save a partly trained Keras model and continue the training after loading the model again. The reason for this ...
(1) odpowiedzi
2017-03-08 08:03 pytest won't convert date field to datetime.date object in Django »
I have this simple query written in Django and I want to run my tests with pytest. results = (self.base_query .order_by('service_d...
(1) odpowiedzi
2017-03-07 23:03 Radial profile of 2D matrix with float indexes »
I have a 2D data array and I'm trying to get a profile of values about its center in an efficient manner. So the output should be two one-dimensional ...
(3) odpowiedzi
2017-03-07 23:03 django admin enable sorting for calculated fields »
I have the following two fields in my db table and model (Model Name: Order): id, branch_id, product_id, cost, quantity, status, ordered_at And I h...
(1) odpowiedzi
2017-03-07 18:03 Python strange behavior with enumerate »
I know I'm not supposed to modify the list inside a loop, but just out of curiosity, I would like to know why the number of iterations is different be...
(6) odpowiedzi