Data dodania Pytanie
2017-02-18 20:02 Strong consistency within transactions in Google Cloud Datastore »
Google Cloud Datastore is a non-relational database, and is built on the concept of eventual consistency. It also supplies a means to get strong consi...
(1) odpowiedzi
2017-02-18 19:02 Dynamic length Django model field »
I have one Django model field definition like this: landMark = models.CharField(max_length=50, blank=True) Can I define the landMark field dynamical...
(2) odpowiedzi
2017-02-18 09:02 Using text file data, classification and make other text file in python »
using python, i want to seperated some data file. file form is text file and there are no tabs only one space between inside data. here is example f...
(2) odpowiedzi
2017-02-18 08:02 Find difference of one row value with remaining row values in python pandas dataframe »
Initial Dataframe: df = Index Nature Interval 0 0 1 0.000000 1 1 1 0.999627 2 ...
(1) odpowiedzi
2017-02-18 01:02 Boolean masking on multiple axes with numpy »
I want to apply boolean masking both to rows and columns. With X = np.array([[1,2,3],[4,5,6]]) mask1 = np.array([True, True]) mask2 = np.array([True...
(3) odpowiedzi
2017-02-17 21:02 Strange Python boolean operator »
I saw some variations of the following simple piece of code: if dist_1>dist_2 : print enemy_2 else: print enemy_1 Variation 1: print (...
(2) odpowiedzi
2017-02-17 21:02 How do I get the number of lists with a particular element? »
I have a list of lists, which looks like listOfLists = [ ['a','b','c','d'], ['a','b'], ['a','c'], ['c','c','c','c'] ] I want to...
(7) odpowiedzi
2017-02-17 21:02 Order-invariant hash in Python »
In Python, I would like to quickly compute an order-invariant hash for the lines of a file as a way to identify "uniquely" its content. These files a...
(2) odpowiedzi
2017-02-17 21:02 Django can't connect to Postgres in Docker setup »
I'm setting up an application in Docker that uses Django and Postgres. I'm unable to connect to Postgres from the app. When I run either: docker-com...
(1) odpowiedzi
2017-02-17 19:02 Where is console input history stored on Python for Windows? »
Good afternoon, The Question Is there a particular spot that the entries are stored, or is it just a local set of stored variables, for the windows ...
(0) odpowiedzi
2017-02-17 11:02 Similar code (for exponentially weighted deviation) is slower in Haskell than in Python »
I implemented exponentially weighted moving average (ewma) in python3 and in Haskell (compiled). It takes about the same time. However when this funct...
(3) odpowiedzi
2017-02-17 11:02 django-leaflet + django-geojson: I can't place a marker in Admin (TypeError: L.drawLocal.draw.toolbar.finish is undefined) »
This might be trivial but I can't find the mistake. I'm just getting the initial setup done following the documentation on GitHub. I've started a new ...
(0) odpowiedzi
2017-02-17 01:02 Python pyodbc cursor vs database cursor »
I use python every day with a heavy emphasis on database work. Using pyodbc my standard start is something like connection_hostname = pyodbc.connec...
(1) odpowiedzi
2017-02-16 21:02 Python - something faster than 2 nested for loops »
def fancymatching(fname1, fname2): #This function will do much smarter and fancy kinds of compares if (fname1 == fname2): return 1 els...
(2) odpowiedzi
2017-02-16 19:02 TypeError when combining ABCMeta with __init_subclass__ in Python 3.6 »
I'm trying to use python 3.6's new __init_subclass__ feature (PEP 487) with the abc module. It doesn't seem to be working. The following code: from a...
(1) odpowiedzi
2017-02-16 13:02 Create a complement of list preserving duplicate values »
Given list a = [1, 2, 2, 3] and its sublist b = [1, 2] find a list complementing b in such a way that sorted(a) == sorted(b + complement). In the exa...
(5) odpowiedzi
2017-02-16 13:02 OR query in django-filter »
I am having difficulty to implement OR query using django-filter. I could find some example telling how to create OR query in django queryset. But, I ...
(2) odpowiedzi
2017-02-16 11:02 How do I resolve these tensorflow warnings? »
I just installed Tensorflow 1.0.0 using pip. When running, I get warnings like the one shown below. W tensorflow/core/platform/cpu_feature_guard.cc:4...
(2) odpowiedzi
2017-02-16 10:02 django 'LineChart' object has no attribute 'get' »
I am trying to make a line chart in django, I am using the jchart module, When I try and load the chart I get the below error. error 'LineChart' ...
(1) odpowiedzi
2017-02-16 04:02 How to keep top 3 rows of each group in a pandas data frame? »
I have a list that looks like this: var1 var2 count A abc 4 A abc 3 A abc 2 A abc 1 A ...
(2) odpowiedzi
2017-02-16 01:02 Can't use django-compress with Heroku »
I have a Django 1.9.6 site deployed to Heroku. When DEBUG=False I was getting a server error (500). The logs contained no useful information, so I t...
(3) odpowiedzi
2017-02-15 16:02 Why numpy converts 20000001 int to float32 as 20000000.? »
I am trying to put some numbers into numpy array >>> np.array([20000001]).astype('float32') array([ 20000000.], dtype=float32) where did 1...
(3) odpowiedzi
2017-02-15 15:02 Count number of occurrences of an array without overlap in another array »
I have a mxn matrix A, where m%t = n%t = 0, so that a smaller txt matrix B tiles the matrix without borders or overlaps. I want to check if A consists...
(2) odpowiedzi
2017-02-15 12:02 How to convert an hexadecimale line in a text file to an array (Python)? »
I have a text file containing in each line an hexadecimal plaintext, My file looks like this: 7a8e5dc390781eab8df2c090bf4bebca dbac0fba55d3d4fc17716...
(1) odpowiedzi
2017-02-15 11:02 Django - get model object attributes from ModelForm »
I have a ModelFormSet: TransactionFormSet = modelformset_factory(Transaction, exclude=("",)) With this model: class Transaction(models.Model): ...
(1) odpowiedzi
2017-02-15 09:02 Django object locking »
I'm using Django 1.8 and I have a model class ModelA(models.Model): some_field = models.PositiveIntegerField() Now, in my view I want to add a...
(2) odpowiedzi
2017-02-15 02:02 How to display an update that is pushed from the server to the webpage without a refresh? »
I am using Django 1.10 as the backend of a warehousing app we built. I am adding another new feature where a webpage that will be displayed on a gian...
(2) odpowiedzi
2017-02-14 23:02 How to convert this text file into a dictionary? »
I have a file f that looks something like: #labelA there is something here #label_Bbb here aswell ... It can have a number of labels and any number...
(7) odpowiedzi
2017-02-14 23:02 Split a list into increasing sequences using itertools »
I have a list with mixed sequences like [1,2,3,4,5,2,3,4,1,2] I want to know how I can use itertools to split the list into increasing sequences c...
(3) odpowiedzi
2017-02-14 21:02 Should a dict that I use only once during initialization be put inside my class? »
I only need to use operatorDict one time to determine which operation I am using for the class. What is the most pythonic way to store the correct ope...
(1) odpowiedzi
2017-02-14 20:02 Algorithm to return a reordered range for data rendering »
Here are examples: given: 1,2,3 [list or range of numbers] return: 2,1,3 [reordered list] given: 1,2,3,4,5 return: 3 1 5 2 4 given: 1,2,3,4,5,6...
(3) odpowiedzi
2017-02-14 19:02 Django find relationship "route" between two Vertexes in a Network »
This is mostly a logical question, but the context is done in Django. In our Database we have Vertex and Line Classes, these form a (neural)network, ...
(1) odpowiedzi
2017-02-14 11:02 Should I avoid converting to a string if a value is already a string? »
Sometimes you have to use list comprehension to convert everything to string including strings themselves. b = [str(a) for a in l] But do I have to...
(1) odpowiedzi
2017-02-13 23:02 Circular pairs from array? »
I can't believe this is nowhere to be found, but: I want all consecutive pairs from an array, including the last element with the first one. I tried: ...
(4) odpowiedzi
2017-02-13 20:02 Why django urls end with a slash? »
Django official documentation and other tutorials on the web always use a trailing slash at the end of url. ex: url(r'^accounts/login/', views.login)...
(3) odpowiedzi