Data dodania Pytanie
2017-12-05 18:12 Newton method in python for multivariables (system of equations) »
My code is running fine for first iteration but after that it outputs the following error: ValueError: matrix must be 2-dimensional To the best of ...
(2) odpowiedzi
2017-12-05 09:12 How disable debuger on chrome webdriver in Python 3.x? »
anybody know how to disable a debugger/logging in chrome webdriver in Python 3.6 ? Debug img I'm trying following code and it isn't working. chrome...
(1) odpowiedzi
2017-12-05 08:12 Django form is not displaying »
I am new to django forms and while trying to design an HTML form, I notice that the django form blocks are not displaying. Below are the codes: <b...
(1) odpowiedzi
2017-12-04 18:12 PIP cannot install Django inside VIrtualenv »
(myenv) wanjila@wanjila:~/Desktop/Python-Area/projects/Djangular$ pip freeze djangorestframework==3.7.3 pkg-resources==0.0.0 (myenv) wanjila@wanjila:~...
(2) odpowiedzi
2017-12-04 15:12 Reordering nodes in increasing order in pandas dataframe »
data1 = { 'node1': [2,2,3,6], 'node2': [6,7,7,28], 'weight': [1,2,1,1], } df1 = pd.DataFrame(data1, columns = ['node1','node2','weight']) ...
(3) odpowiedzi
2017-12-04 10:12 Using the reserved word "class" as field name in Django and Django REST Framework »
Description of the problem Taxonomy is the science of defining and naming groups of biological organisms on the basis of shared characteristics. Orga...
(2) odpowiedzi
2017-12-04 03:12 Python: Modify the internal behavior of a function by using decorator »
I'm learning to use python decorator. def my_dcrtr(fun): def new_fun(): return fun() return new_fun I realize the decorated functio...
(1) odpowiedzi
2017-12-04 01:12 Calculating the outer product for a sequence of numpy ndarrays »
I have a list of 3D points p stored in an ndarray with shape (N, 3). I want to compute the outer product for each 3d point with itself: N = int(1e4) ...
(3) odpowiedzi
2017-12-03 22:12 multiplying 2 integers of the same value by 300 yields different results »
I am trying to figure out why a difference of 283 happens when I decide to multiply rather than divide. Here is some Python code from my terminal. As...
(2) odpowiedzi
2017-12-03 20:12 Can I use the Node.js packages along with Django? »
I think I haven't understood this concept right . If I am using Django as a backend to run server side code , is there a way to include the packages o...
(2) odpowiedzi
2017-12-03 19:12 Why a form don't need 'action'? UserCreationForm »
I create a form using django auth forms UserCreationForm and it works without 'action' inside . Why it works? views.py def sign_up(request): if ...
(2) odpowiedzi
2017-12-03 16:12 text classification of large dataset in python »
I have 2.2 million data samples to classify into more than 7500 categories. I am using pandas and sckit-learn of python to do so. Below is the sample...
(1) odpowiedzi
2017-12-03 14:12 Address sanitizing Boost.Python modules »
My project includes a large C++ library and Python bindings (via Boost.Python). The test suite is mostly written on top of the Python bindings, and I...
(1) odpowiedzi
2017-12-03 14:12 Length of the longest sub-array which consists of all '1' »
suppose i have a list say x=[1,0,0,1,0,1,1,1,0,1,1,0].Here longest sub-array which have continuous 1 is of length 3. I have a o(n) approach but can it...
(3) odpowiedzi
2017-12-03 14:12 How generate all pairs of values, from the result of a groupby, in a pandas dataframe »
I have a pandas dataframe df: ID words 1 word1 1 word2 1 word3 2 word4 2 word5 3 word6 3 word7 3 word8 3 ...
(3) odpowiedzi
2017-12-03 01:12 Why The Runtime and the timeit is different in my code in python? »
I wrote below code and try to see how fast my function is. I used timeit. The factorial result prints very fast (less than 1 sec) but the timer (func_...
(0) odpowiedzi
2017-12-02 15:12 Python interpreter takes ~12 seconds to start up, all of which is spent in `import pyexpat` »
I am using a Homebrew-installed Python on my Mac (running OS X 10.13.1), and of late, I’ve noticed that the interpreter takes a frustratingly long t...
(0) odpowiedzi
2017-12-02 14:12 How to detect from within Python whether packages are managed with conda »
I would like to detect in a general way from within a Python session whether it is managed by conda. A few ideas that are not general enough to be us...
(4) odpowiedzi
2017-12-02 13:12 Python - Float variable always returning as largest in comparative »
I am experiencing problems with a variable in my code. Here is part of my code: import re name = raw_input("Input the Character's name: ") name = na...
(2) odpowiedzi
2017-12-02 10:12 Django image form isn't saving the image »
I have a form that involves uploading a profile picture. I have it working so that I can upload images in the /admin/ interface and display them corre...
(1) odpowiedzi
2017-12-02 05:12 How to split a list-of-strings into sublists-of-strings by a specific string element »
I have a word list like below. I want to split the list by .. Is there any better or useful code in Python 3? a = ['this', 'is', 'a', 'cat', '.', 'he...
(6) odpowiedzi
2017-12-02 01:12 Seemingly straightforward recursive function ends in infinite loop »
I have written the following code: def incr_num(x, y): while x <= y: print x incr_num(x+1, y) When I invoke this as incr_...
(4) odpowiedzi
2017-12-02 01:12 Recieving Attribute Erro regarding 'BetaCandidateServicer' using gRPC? »
I'm using Python 2.7 and Proto3 and receiving the error: E1201 19:25:26.880457900 25127 ev_epollex_linux.cc:1482] Skipping epollex becuase GRPC_L...
(0) odpowiedzi
2017-12-02 00:12 How to save datetime with tzlocal() into MariaDB? »
I'm coming from a Postgres background and am new to MariaDB (MySQL). When trying to save a DateTime into MariaDB, I'm getting this error. sqlalchemy...
(0) odpowiedzi
2017-12-01 20:12 Fastest way to sort string to match second string - only adjacent swaps allowed »
I want to get the minimum number of letter-swaps needed to convert one string to match a second string. Only adjacent swaps are allowed. Inputs are: ...
(3) odpowiedzi
2017-12-01 19:12 pybind11: how to package c++ and python code into a single package? »
I am trying to package together an existing Python code and a new C++ 11 code using CMake and pybind 11. I think I am missing something simple to add ...
(2) odpowiedzi
2017-12-01 10:12 summing nested iterables with map-reduce/itertools »
I've been stuck with this data structure for a while now: iter([iter([1,0]),iter([1,1]),iter([0,0])]) I want to get to sum of the inner-most elemen...
(1) odpowiedzi
2017-12-01 10:12 Django Postgresql JsonField query related dictionary keys »
A part of the model that I have, which uses Django Model field, is like the following: class SalesModel(models.Model): some_data = models.Positiv...
(3) odpowiedzi
2017-12-01 04:12 Is it a bad practice to use a class to store globals »
I have seen this done quite a bit. Example: class Namespace(object): timeout = 0.5 socket.settimeout(Namespace.timeout) Why not just use a name...
(0) odpowiedzi
2017-12-01 02:12 Why is len() not implemented for Queues? »
The built-in function len() (https://docs.python.org/3/library/functions.html#len) returns "the length (the number of items) of an object", but this i...
(1) odpowiedzi
2017-11-30 20:11 Given a string of a million numbers, return all repeating 3 digit numbers »
I had an interview with a hedge fund company in New York a few months ago and unfortunately, I did not get the internship offer as a data/software eng...
(10) odpowiedzi
2017-11-30 20:11 Looking to speed up loop including pandas operations »
I need help speeding up this loop and I am not sure how to go about it import numpy as np import pandas as pd import timeit n = 1000 df = pd.DataFra...
(2) odpowiedzi
2017-11-30 19:11 JSON data not coming through from Django REST API »
I have a Django REST API with an Angular Front-end. I am getting no errors on the front-end, but no json data is logging to the console. I have a se...
(1) odpowiedzi
2017-11-30 15:11 Printing to NamedTemporaryFile on Windows »
The original Problem - MCVE The following script should use chrome headless, to print to pdf (I am running windows 10, and python 3.6): import subp...
(2) odpowiedzi
2017-11-30 11:11 Storing Spanish characters in MSSQL Database »
I need to store the Spanish characters á,é,í,ó,ú,ü,ñ,¿,¡ in the MSSQL 2014 Database having iso-1 as the character set and SQL_Latin1_General_...
(0) odpowiedzi