Q_Id
int64
337
49.3M
CreationDate
stringlengths
23
23
Users Score
int64
-42
1.15k
Other
int64
0
1
Python Basics and Environment
int64
0
1
System Administration and DevOps
int64
0
1
Tags
stringlengths
6
105
A_Id
int64
518
72.5M
AnswerCount
int64
1
64
is_accepted
bool
2 classes
Web Development
int64
0
1
GUI and Desktop Applications
int64
0
1
Answer
stringlengths
6
11.6k
Available Count
int64
1
31
Q_Score
int64
0
6.79k
Data Science and Machine Learning
int64
0
1
Question
stringlengths
15
29k
Title
stringlengths
11
150
Score
float64
-1
1.2
Database and SQL
int64
0
1
Networking and APIs
int64
0
1
ViewCount
int64
8
6.81M
41,824,077
2017-01-24T09:07:00.000
1
0
1
0
python-3.x,path,pycharm
41,824,866
2
false
0
0
I user various methods in my python scripts. set the working directory as first step of your code using os.chdir(some_existing_path) This would mean all your other paths should be referenced to this, as you hard set the path. You just need to make sure it works from any location and your specifically in your IDE. Obv...
1
1
0
When running an interactive session, PyCharm thinks of os.getcwd() as my project's directory. However, when I run my script from the command line, PyCharm thinks of os.getcwd() as the directory of the script. Is there a good workaround for this? Here is what I tried and did not like: going to Run/Edit Configurations a...
PyCharm project path different from interactive session path
0.099668
0
0
773
41,827,464
2017-01-24T11:47:00.000
0
0
1
0
python,pip,centos7,pycparser
43,140,645
3
false
0
0
same solution worked for me pip install setuptools==33.1.1 and then sudo pip install -r requirements.txt
1
8
0
I am seeing the following error while setting up pyparser on CentOS 7 via pip /usr/bin/python2 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-PMzCYU/pycparser/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-0bpBrX...
python pycparser setup error
0
0
0
6,122
41,831,529
2017-01-24T15:06:00.000
0
0
0
0
python,pymc
41,834,290
1
true
0
0
There is currently no way to plot them without being saved to disk. I would recommend only plotting a few diagnostic parameters, and specifying plot=False for the others. That would at least cut down on the volume of plots being generated. There probably should be a saveplot argument, however, I agree.
1
0
1
I recently started experimenting with pymc and only just realised that the images being produced by pymc.Matplot.plot, which I use to diagnose whether the MCMC has performed well, are being saved to disk. This results in images appearing wherever I am running my scripts from, and it is time consuming to clear them up. ...
Stop images produced by pymc.Matplot.plot being saved
1.2
0
0
60
41,832,838
2017-01-24T16:06:00.000
20
0
0
0
python,python-3.x,pip,python-requests
41,832,839
2
true
0
0
Run sudo python3 -m pip install "requests[security]" or sudo python -m pip install "requests[security]" to fix this issue.
1
11
0
I have been having this error when trying to make web requests to various hosts. After debugging a bit I have found the solution is updating the requests[security] through pip.
Python Error 104, connection reset by peer
1.2
0
1
30,212
41,833,790
2017-01-24T16:48:00.000
3
1
0
1
python,oracle,amazon-web-services,lambda,cx-oracle
41,837,986
1
true
0
0
If you can limit yourself to English error messages and a restricted set of character sets (which does include Unicode), then you can use the "Basic Lite" version of the instant client. For Linux x64 that is only 31 MB as a zip file.
1
1
0
I must load the Oracle "instant client" libraries as part of my AWS lambda python deployment zip file. Problem is, many of the essential libraries (libclntsh.so.12.1 is 57MB libociei.so is 105MB) and Amazon only allows deployment zip files under 50MB. I tried: my script cannot connect to Oracle using cx_Oracle witho...
AWS python Lambda script that can access Oracle: Driver too big for 50MB limit
1.2
1
0
846
41,833,928
2017-01-24T16:54:00.000
0
0
1
0
java,python,eclipse,plugins,pydev
42,008,120
1
false
0
0
Take a look at com.python.pydev.refactoring.refactorer.refactorings.renamelocal.RefactoringLocalTestBase.applyRenameRefactoring(RefactoringRequest, boolean) -- used from com.python.pydev.refactoring.refactorer.refactorings.renamelocal.RenameBuiltinTest.testRename3() (you can try to do a debug session there to understan...
1
0
0
I'm trying to call the pydev refactoring dialog and put the new/old string for refactoring and the file, but did not find in the tests of pydev source.
How to put strings in Pydev refactoring dialog from eclipse plugin?
0
0
0
109
41,834,141
2017-01-24T17:04:00.000
0
0
1
0
python-3.x,ipython
41,849,001
1
false
0
0
Shame on me, it was just a typo: the correct module is named sklearn.ensemble.
1
0
1
When I launch ipython -i script_name or load the script with %load, it fails loading sklearn.ensamble. But it succeed in loading and I am able to use it when I launch ipython alone and then from sklearn.ensamble import *. Why?
ipython can't load module when using magic %load, but succeed when loading interactively
0
0
0
21
41,836,727
2017-01-24T18:50:00.000
0
0
0
0
python,pandas
41,836,728
1
true
0
0
np.inf is treated the same way np.NaN. I replaced the all the values of np.inf with np.NaN and the results were exactly the same. If there is some subtle differences, please let me know. I was looking for an answer on this and couldn't find one anywhere so I figured I would post this here.
1
1
1
What will happen when I use df.corr()? Will np.inf effect my results some how?
I have a DataFrame with some values of np.inf. How does .corr() work?
1.2
0
0
72
41,838,726
2017-01-24T20:48:00.000
0
0
0
0
python-2.7,module,scikit-learn,grid-search
41,839,189
1
false
0
0
I just found the answer. the 0.18 sklearn has seen a number of updates. you may update your sklearn by typing "conda update scikit-learn" in your windows command line. If it still didn't code you might want to update your conda/Anaconda as well: "conda update conda" and "conda update Anaconda"
1
0
1
I try to run this line: from sklearn.model_selection import GridSearchCV but I get an ImportError (i.e. No module named model_selection) although I have installed sklearn and I can import other packages. here is my python version : 2.7.12 |Anaconda 4.2.0 (64-bit)| (default, Jun 29 2016, 11:07:13) [MSC v.1500 64 bit ...
can't install model_selection on python 2.7.12
0
0
0
238
41,838,779
2017-01-24T20:52:00.000
4
0
1
0
python,python-2.7,python-3.x,dsx,data-science-experience
41,845,926
2
true
0
0
While the method presented in another answer (look for specific environment variables) works today, it may stop working in the future. This is not an official API that DSX exposes. It will obviously also not work if somebody decides to set these environment variables on their non-DSX system. My take on this is that "No...
1
1
0
How can I programmatically determine if the python code in my notebook is running under DSX? I'd like to be able to do different things under a local Jupyter notebook vs. DSX.
Programmatically determine if running in DSX
1.2
0
0
106
41,843,266
2017-01-25T04:14:00.000
73
0
1
0
windows,visual-studio,pycrypto,python-3.6
41,843,310
9
true
0
0
The file include\pyport.h in Python installation directory does not have #include < stdint.h > anymore. This leaves intmax_t undefined. A workaround for Microsoft VC compiler is to force include stdint.h via OS environment variable CL: Open command prompt Setup VC environment by runing vcvars*.bat (choose file name d...
2
42
0
pip install pycrypto works fine with python3.5.2 but fails with python3.6 with the following error: inttypes.h(26): error C2061: syntax error: identifier 'intmax_t'
Microsoft Windows Python-3.6 PyCrypto installation error
1.2
0
0
54,800
41,843,266
2017-01-25T04:14:00.000
2
0
1
0
windows,visual-studio,pycrypto,python-3.6
60,353,443
9
false
0
0
Uninstall your current Python version Install Python for amd64 architecture Follow the other accepted solutions: open "x86_x64 Cross-Tools Command Prompt for VS 2017" Add the new enviroment varible for your Visual Studio MSVC install path set CL=-FI"%VCINSTALLDIR%Tools\MSVC\14.11.25503\include\stdint.h" pip install...
2
42
0
pip install pycrypto works fine with python3.5.2 but fails with python3.6 with the following error: inttypes.h(26): error C2061: syntax error: identifier 'intmax_t'
Microsoft Windows Python-3.6 PyCrypto installation error
0.044415
0
0
54,800
41,845,657
2017-01-25T07:23:00.000
5
0
1
0
python,session,flask,shelve
41,957,026
2
true
1
0
I recommend take a look at NoSQL storage engines like Memcached or Redis. They give you several advantages: Place at a separate machine, so if you need to scale your app you'll be able to do it. Extra interface to check what is stored in them. Ability to flush if you really need once. You can connect other apps to the...
1
3
0
Writing a web based flask api application with several modules. I would like to incorporate different permissions and privileges for different user logins for the different modules. Query is whether these privileges should be stored as session dictionaries or as shelve values? Which is more efficient and faster? Why wo...
Should we store session privileges in python shelve or as session variables?
1.2
0
0
226
41,846,630
2017-01-25T08:26:00.000
0
0
0
0
python,matlab,python-2.7,parameter-passing,language-interoperability
41,846,775
2
false
0
0
Depending on what you want to do and your type of data, you could write it to a file and read from it in the other language. You could use numpy.fromfile for that in the python part.
1
0
1
Hello Friends, I want to pass data between MATLAB and Python, One way would be to use matlab.engine in Python or Call Python Libraries from MATLAB. But this approach requires MATLAB 2014 Version unlike mine which is MATLAB R2011b. So I request you to please guide for a different Approach in order to comunicate between ...
Pass data between MATLAB R2011b and Python (Windows 7)
0
0
0
110
41,850,349
2017-01-25T11:22:00.000
0
0
1
0
python,scikit-learn
41,851,421
2
false
0
0
I'm not sure if there is a single method of treating class_weight for all the algorithms. The way Decision Trees (and Forests) deals with this is by modifying the weights of each sample according to its class. You can consider weighting samples as a more general case of oversampling all the minority class samples (usin...
1
0
1
I would like to know how scikit-learn put more emphasis on a class when we use the parameter class_weight. Is it an oversampling of the minority sampling ?
How class_weight emphasis a class in in scikit-learn
0
0
0
420
41,850,411
2017-01-25T11:25:00.000
1
0
0
0
python,neo4j,authorization,graph-databases,py2neo
42,622,083
2
true
0
0
At the moment it is not possible to write procedures for custom roles to implement subgraph access control using Python. It is only possible in Java. A workaround might be to indirektly implement it using phyton by adding properties to nodes and relationship storing the security levels for these nodes and relationships...
1
2
0
I have some employee data in which there are 3 different roles. Let's say CEO, Manager and Developer. CEO can access the whole graph, managers can only access data of some people (their team) and developers can not access employee data. How should I assign subgraph access to user roles and implement this using Python?...
Authorization (subgraph access control) in Neo4j with python driver
1.2
1
1
304
41,856,693
2017-01-25T16:28:00.000
1
0
1
1
python,homebrew,uninstallation,removeall
41,857,222
1
true
0
0
To remove it there are 2 changes: remove the /Users/user/anaconda2 directory change your path to not use any /Users/user/anaconda2 directories. However I suggest you download Anaconda again and use environments rather than your root folder for everything. Use conda to install packages when possible (most of the time...
1
1
0
I had Python 2.7 for few months on my Mac and after installing one module - every other module got corrupted. Tried several hours of different ways to repair but did not work. Virtual-env also does now work now. I would like to remove ALL Python modules from my Mac along with Python and reinstall it with Brew (or other...
Delete ALL Python 2.7 modules and Python from Mac
1.2
0
0
840
41,856,832
2017-01-25T16:34:00.000
0
0
1
0
python,python-2.7,operating-system,locks,readerwriterlock
41,869,149
1
true
0
0
Writer: Upload a file W. If this fails, wait and try again. Upload a file R. If this fails, wait and try again. Do as many writes as desired. Remove W. Remove R. Reader: Upload a file R. If this fails, wait and try again. Check for the existence of a file W. If it exists, remove R and return to step 1. Do one re...
1
0
0
For this question simplictly , I'm having two types of computers: type A and B. There is one computer of type A, and many of type B. B are type of hosts which can write and read from ftp. A is a computer which can just read from ftp. As you might already guess, ftp is the shared area which need to be protected by rea...
Reader writer lock with preference to writers
1.2
0
0
460
41,857,126
2017-01-25T16:49:00.000
0
0
0
1
python,amazon-web-services,heroku,cron
50,078,814
3
false
1
0
Update: AWS does now support Python 3.6. Just select Python 3.6 from the runtime environments when configuring.
1
0
0
Say I have a file "main.py" and I just want it to run at 10 minute intervals, but not on my computer. The only external libraries the file uses are mysql.connector and pip requests. Things I've tried: PythonAnywhere - free tier is too limiting (need to connect to external DB) AWS Lambda - Only supports up to Python 2.7...
How can I run a simple python script hosted in the cloud on a specific schedule?
0
0
0
549
41,857,884
2017-01-25T17:27:00.000
1
0
0
0
python,python-2.7,pdf,base64,imaplib
41,858,705
1
true
1
0
email.header.decode_header() was exactly what I needed. Thanks so much! Added the following lines: filename = part.get_filename() if decode_header(filename)[0][1] is not None: filename = str(decode_header(filename)[0][0]).decode(decode_header(filename)[0][1]) filename_zero, fileext = os.path.splitext(filename) fi...
1
0
0
I have a program that will pull file attachments into a network share. I have this working in both single part and multi-part email messages. I have recently received a mutlipart that is showing as : Content-Type: application/pdf Content-Disposition: attachment; filename="=?utf-8?B?SW52b2ljZShzKS5wZGY=?=" Content-Tran...
PDF Attachment Downloader not working with base64 Encoding
1.2
0
0
405
41,862,312
2017-01-25T21:51:00.000
2
0
0
0
python,google-cloud-storage,boto,google-developer-tools
41,862,332
2
false
0
0
Look into gcs-fuse: Makes like a lot easier since you then can use the GCS as just a standard file system.
1
0
0
I'm trying to figure out how to download a file from google cloud storage bucket. My use-case is to run a scheduled script which downloads a .csv file once a day and save it to a SQL DB. I considered doing it using python and the google SDK but got lost with all the options and which one is the right for me. Could some...
Programatically download file from google cloud storage bucket
0.197375
1
0
736
41,863,814
2017-01-25T23:51:00.000
5
0
0
0
python,statistics,tensorflow,entropy
41,864,069
7
false
0
0
I'm not sure why it's not implemented, but perhaps there is a workaround. The KL divergence is defined as: KL(prob_a, prob_b) = Sum(prob_a * log(prob_a/prob_b)) The cross entropy H, on the other hand, is defined as: H(prob_a, prob_b) = -Sum(prob_a * log(prob_b)) So, if you create a variable y = prob_a/prob_b, you could...
1
15
1
I have two tensors, prob_a and prob_b with shape [None, 1000], and I want to compute the KL divergence from prob_a to prob_b. Is there a built-in function for this in TensorFlow? I tried using tf.contrib.distributions.kl(prob_a, prob_b), but it gives: NotImplementedError: No KL(dist_a || dist_b) registered for dist_a...
Is there a built-in KL divergence loss function in TensorFlow?
0.141893
0
0
17,205
41,867,109
2017-01-26T04:52:00.000
0
0
1
0
python,coala,coala-bears
45,793,120
1
false
0
0
Hey the AnnotationBear yields, HiddenResult which are results meant to be used by other bears, and not be directly viewed by the user. If you are trying to test coala, you should check bears which actually give results, for eg: PyFlakesBear
1
0
0
when i tried to check the bear results for a python file by using coala --bears AnnotationBear -f add.py --save and when it asked for setting language- give "python", then on checking .coafile i didn't find any result that AnnotationBear has to give so, how to check result?
Checking result by applying bear on file
0
0
0
49
41,868,290
2017-01-26T07:01:00.000
0
0
1
0
python,regex
41,868,352
2
false
1
0
Your + is at the wrong position; your regexp, as it stands, would demand /John /Adam /Will /Newman, with a trailing space. r'((/)((\w)+(\s))+)' is a little better; it will accept /John Adam Will, with a trailing space; won't take Newman, because there is nothing to match \s. r'((/)(\w+(\s\w+)*))' matches what you poste...
1
0
0
I had a pdf in which names are written after a '/' Eg: /John Adam Will Newman I want to extract the names starting with '/', the code which i wrote is : names=re.compile(r'((/)((\w)+(\s)))+') However, it produces just first name of the string "JOHN" and that too two times not the rest of the name.
Incorrect output due to regular expression
0
0
0
43
41,869,435
2017-01-26T08:30:00.000
1
0
1
0
python-2.7,contextmenu,python-idle
41,891,633
2
true
0
0
I got the solution... At time of saving python code, there will be two extensions displayed .py and .pyw.I saved my file using .pyw extension i.e. instead of saving as my.py saved as my.pyw. After that again right click on file and there is an option for Edit with IDLE.
2
1
0
Recently I have installed Python 2.7.13 in my Windows 10. When I try to open my python program by right clicking on it, but I can not find option Edit with IDLE. I have tried solutions that are given in other stack overflow questions but still not working. Answers that I have found on other Stack Overflow questions are...
"Edit with IDLE" not in context menu
1.2
0
0
477
41,869,435
2017-01-26T08:30:00.000
0
0
1
0
python-2.7,contextmenu,python-idle
70,979,522
2
false
0
0
BOYS. I DID IT. I really don't know anything about coding or whatnot, but I had the same problem. In my case, I had idle 3.10 downloaded, but "edit with idle" only appeared with Idle 2.7. I also had "edit with Idle - 3.5 (32-bit)" but this didn't open. Anyways, so I went to the registry Computer\HKEY_CLASSES_ROOT\Pytho...
2
1
0
Recently I have installed Python 2.7.13 in my Windows 10. When I try to open my python program by right clicking on it, but I can not find option Edit with IDLE. I have tried solutions that are given in other stack overflow questions but still not working. Answers that I have found on other Stack Overflow questions are...
"Edit with IDLE" not in context menu
0
0
0
477
41,870,827
2017-01-26T09:55:00.000
0
0
1
1
python,windows,macos,compatibility
41,870,988
2
false
0
0
You should use #!/usr/bin/env python as your first line in the script. It will be applied when you make the script executable and run it like ./script.py
2
0
0
Iv'e written simple python script in the windows version. written in python 2.7, code compatible to 3.4 runs as script with #! /usr/bin/python Will it run as is on mac? Would like to know this before i distribute it to mac users and don't have a mac machine to test it.
Running python script written in windows on mac
0
0
0
2,469
41,870,827
2017-01-26T09:55:00.000
0
0
1
1
python,windows,macos,compatibility
41,871,000
2
false
0
0
Short answer: It might run. Long answer: OS compatibility is a tricky issue. When writing code, make sure that it is portable as much as possible. Most of the basic operations in python are portable between OSes. When it comes to file reading, writing, enconding handling etc. stuff might go horribly wrong. Use the prov...
2
0
0
Iv'e written simple python script in the windows version. written in python 2.7, code compatible to 3.4 runs as script with #! /usr/bin/python Will it run as is on mac? Would like to know this before i distribute it to mac users and don't have a mac machine to test it.
Running python script written in windows on mac
0
0
0
2,469
41,870,983
2017-01-26T10:04:00.000
1
0
1
0
python,linux,ubuntu
41,871,906
1
false
0
0
ls -la /usr/bin/python* should show you all of your python executables.
1
0
0
How to list installed python interpretators? For example which python give me only the current python interpretator, but I need all of them. If it matters I using Ubuntu 12.04.
How to list installed python interpretators?
0.197375
0
0
36
41,871,919
2017-01-26T10:54:00.000
1
0
1
0
ipython,prompt-toolkit
41,872,216
2
true
0
0
On my own Belgian Mac keyboard, fnshift↑ does the job. But I cannot tell whether this also works for other locales.
2
1
0
IPython 5 is a big release. One of its features is real multi-line editing with prompt_toolkit. The up arrow key now moves to the previous input line instead of the previous input command (block of lines). This is awesome, but when my previous command spans many lines, and I need to reach the command before that, I fin...
Go up one command instead of one line in IPython 5
1.2
0
0
215
41,871,919
2017-01-26T10:54:00.000
1
0
1
0
ipython,prompt-toolkit
45,620,822
2
false
0
0
The PageUp and PageDown keys do exactly what you want without any chorded hotkeys involved; they work on an entry-oriented basis, rather than the arrow keys' line oriented approach.
2
1
0
IPython 5 is a big release. One of its features is real multi-line editing with prompt_toolkit. The up arrow key now moves to the previous input line instead of the previous input command (block of lines). This is awesome, but when my previous command spans many lines, and I need to reach the command before that, I fin...
Go up one command instead of one line in IPython 5
0.099668
0
0
215
41,876,074
2017-01-26T14:46:00.000
0
0
0
0
python,grid,tiles
41,876,242
1
false
0
1
You just divide the tile number by the number of tiles in a row w: row = t//w To get the column do: col = t%w I assume both row and column start at zero. If not, just add 1 where you need.
1
0
0
Say I have a grid that looks something like this: 0 1 2 3 4 5 6 7 Imagine that we have a w by h grid, where the tiles are numbered starting at 1 in the top left corner. Imagine someone else has stored the values w (for width) and h (for height), that they have read in from a text file. You have access to these stored ...
Figuring out a Row of a Tile number in Python
0
0
0
808
41,884,981
2017-01-26T23:42:00.000
1
0
1
0
python,twitter,twitter-oauth
41,887,118
4
true
0
0
Hope below works import pprint users = api.friends() pprint.pprint([u.name for u in users], width=1)
1
1
0
I am using the following code to print the list of friends in twitter users = api.friends() print([u.name for u in users]) I get the following output ['The New York Times', 'BBC Breaking News', 'Oprah Winfrey'] But I want something like this ['The New York Times', 'BBC Breaking News', 'Oprah Win...
How to insert a line break within the for loop of a print statement using python
1.2
0
0
2,997
41,886,791
2017-01-27T04:04:00.000
2
0
0
0
python,excel,python-3.x,module,xlrd
41,904,256
1
true
0
0
xlrd only reads excel files. To write them, look up xlwt, xlutils, xlsxwriter, or openpyxl - all of these packages can write binary files excel can read. Excel can also read csv files, which the csv package (included with Python) can write (and read).
1
1
0
How can I write an excel file(xls/xlsx) using xlrd module alone? I tried from xlrd import xlsx, but couldn't find anything that will really help me.
How to use xlrd for writing an excel file
1.2
1
0
4,503
41,889,588
2017-01-27T08:24:00.000
1
0
1
0
python,user-interface,model-view-controller,interface
41,889,758
1
true
0
1
Well maybe have the function in the Core module return some specifier that such a thing has happened (found multiple) along with the given names, then display the choice to the user and call a function in the Core module that returns relevant information about that file. Bear in mind you do not have to be dogmatic rega...
1
0
0
Hi I know this is a pretty basic design question. But I don't realy get it.... I write it in Python with PySide, but I think this is more a language unrelated question. A simplified example what I want to do: I Have a Gui with a button that opens a file dialog. In this one I choose a folder. The code scans the suffixe...
clean divide Code and Gui
1.2
0
0
48
41,895,868
2017-01-27T14:08:00.000
0
1
1
0
python,python-3.x,ubuntu,importerror,pycrypto
41,896,166
2
false
0
0
Is python defined properly on your machine? Make sure PATH environment variable has python's installation folder in it
1
0
0
I am getting ImportError: No module named 'Crypto' error when trying to run. I have installed pycrypto using pip install pycrypto and updated it also. Everything I have tried to far has been unsuccessful. Tried: reinstalling pycrypto, updating both python and pycrypto Any suggestions?
Getting ImportError: No module named 'Crypto' after installation
0
0
0
922
41,898,424
2017-01-27T16:18:00.000
11
0
1
0
python,python-wheel,software-packaging,python-packaging
55,031,535
3
false
0
0
Wheel provides the wheel command in addition to just setup.py bdist_wheel. Use wheel unpack [file.whl] to open the wheel, edit what you will, and then use wheel pack [directory] to put it back together again.
2
6
0
I have a python wheel package, when extracted I find some python code, I'd like to edit this code and re-generate the same .whl package again and test it to see the edits .. How do I do that?
How to edit a wheel package (.whl)?
1
0
0
8,816
41,898,424
2017-01-27T16:18:00.000
0
0
1
0
python,python-wheel,software-packaging,python-packaging
54,548,346
3
false
0
0
you can open the whl file using 7zip or something alike, track the file you wish to change, open in edit mode, save it, next 7zip will popup a message saying something was modified and if you want the change to be saved, press yes and youre good to go. remember to backup your original whl before doing it..
2
6
0
I have a python wheel package, when extracted I find some python code, I'd like to edit this code and re-generate the same .whl package again and test it to see the edits .. How do I do that?
How to edit a wheel package (.whl)?
0
0
0
8,816
41,899,011
2017-01-27T16:49:00.000
2
0
0
0
python,machine-learning,scikit-learn,real-time
41,911,859
2
false
0
0
With most algorithms training is slow and predicting is fast. Therefore it is better to train offline using training data; and then use the trained model to predict each new case in real time. Obviously you might decide to train again later if you acquire more/better data. However there is little benefit in retraining ...
2
2
1
I have a real time data feed of health patient data that I connect to with python. I want to run some sklearn algorithms over this data feed so that I can predict in real time if someone is going to get sick. Is there a standard way in which one connects real time data to sklearn? I have traditionally had static datase...
Real time data using sklearn
0.197375
0
0
2,016
41,899,011
2017-01-27T16:49:00.000
2
0
0
0
python,machine-learning,scikit-learn,real-time
43,380,457
2
false
0
0
It is feasible to train the model from a static dataset and predict classifications for incoming data with the model. Retraining the model with each new set of patient data not so much. Also breaks the train/test mode of testing a ML model. Trained models can be saved to file and imported in the code used for real time...
2
2
1
I have a real time data feed of health patient data that I connect to with python. I want to run some sklearn algorithms over this data feed so that I can predict in real time if someone is going to get sick. Is there a standard way in which one connects real time data to sklearn? I have traditionally had static datase...
Real time data using sklearn
0.197375
0
0
2,016
41,899,083
2017-01-27T16:52:00.000
4
0
0
0
python,django,orm,model
41,899,169
1
true
1
0
This is unnecessarily complex. There is no performance overhead to having a many-to-many relationship. This is represented by an intermediary table in the database; there's no actual field in the humans table. If an item doesn't have any m2m members, then no data is stored.
1
0
0
I'm setting up my Models and I'm trying to avoid using ManyToMany Relationships. I have this setup: Model: Human Some Humans (a small percentage) need to have M2M relationships with other Humans. Let's call this relationship "knows" (reverse relationship called "is_known_by"). To avoid setting a ManyToManyField in Hum...
Performance impact of reverse relationships in Django
1.2
0
0
200
41,899,930
2017-01-27T17:41:00.000
0
0
1
0
python,algorithm
41,908,820
2
false
0
0
We can do it in the following manner: first get all the (x,y) tuples (indices) of the matrix A where A[x,y]=1. Let there be k such indices. Now roll a k-sided unbiased dice M times (we can simulate by using function randint(1,k) drawing sample from uniform distribution). If you want samples with replacements (same posi...
1
1
1
There is a 0-1 matrix, I need to sample M different entries of 1 value from this matrix. Are there any efficient Python implements for this kind of requirement? A baseline approach is having M iterations, during each iteration, randomly sample 1, if it is of value 1, then keep it and save its position, otherwise, conti...
sample entries from a matrix while satisfying a given requirement
0
0
0
49
41,902,587
2017-01-27T20:35:00.000
1
0
1
0
python,shell,python-idle
41,903,870
2
false
0
0
No, not at present. Shell currently uses tabs to indent, and tabs are fixed in tk as 8 'spaces'. I believe at least part of the reason is so that follow-up lines are visually indented in spite of the >>> prompt. I don't like this either. In the future, I would like to move the prompt into a sidebar so that entered co...
1
0
0
I'm not asking about Options > Configure IDLE > Fonts/Tabs > Indentation Width and setting that to 2. This only sets the indentation width within a file and not the indentation width for the interactive shell. What Python IDLE file do I need to change to get 2-space spacing in the interactive shell? I like to code with...
Is there any way to set Python IDLE's interactive shell indentation width to 2 spaces instead of its default?
0.099668
0
0
445
41,909,158
2017-01-28T11:19:00.000
0
0
0
1
python,hadoop
41,911,541
1
true
0
0
The only way you can do it is if files B and C are very small so that you can put them into the distcache and fetch them in all your Job. There is no partitioner Job in Hadoop. Partitioners run as part of map jobs, so it's the every mapper that has to read all 3 files A,B and C. The same applies to the reducer part....
1
0
0
Say I have 3 input files A, B, C. I want that the mapper only gets records from A the partitioner gets input from both the mapper and files B and C the reducer gets input from the mapper (which has been directed by the partitioner) and file C. Is this possible to do in Hadoop? P.S. - I am using Python and Hadoop Str...
Give specific input files to mapper and reducer hadoop
1.2
0
0
63
41,910,758
2017-01-28T14:13:00.000
0
0
0
0
python,c,linux,gcc,shared-libraries
42,325,888
1
false
0
1
Your problem has nothing to do with exporting symbols, but with the dynamic linker locating PyType_GenericNew. If libpython3.5m.so is in your library path, and your dynamic linker doesn't find it, running strace ldd ./program will provide a hint as to where it's looking, and a well-placed symbolic link may sort you out...
1
0
0
I am working on embedding some python code into into a kdb database by creating c extensions. To do this I need to compile my code into a shared library and within my kdb q script load the shared library. This issue I am having is when I try to import the numpy module. I get an error saying the PyType_GenericNew is ...
Get full path to shared object with python c api
0
0
0
220
41,912,691
2017-01-28T17:29:00.000
0
0
1
0
python,python-3.x,pyqt,pycharm
41,919,317
1
true
0
1
Since you do seem to have PyQt installed my guess is that you have multiple Python versions installed (version 3.4 and version 3.6) and that PyQt is only installed under 3.6, but that PyCharm and the Designer are configured to use 3.4. I don't know how to change the Python interpreter in the Qt Designer as I never use ...
1
1
0
I am a beginner and have 2 issues, which may be related to each other. 1. I am using PyCharm, and when I put "from PyQt4 import QtCore, QtGui, uic" I get a red line under each word (except from & import) saying "unresolved reference". I have PyQ4/Designer installed (I know it is because I have made a GUI), but whe...
PyCharm not recognizing PyQT4 and PyQt4 not allowing me to 'view code'
1.2
0
0
1,774
41,913,345
2017-01-28T18:34:00.000
1
0
0
0
python,flask,python-import,file-not-found
42,589,534
9
false
1
0
Please follow these steps: Make sure you have already done with [pip install --editable . ]. where '.' represent the location of directory where your app is installed. e.g(flask_app) Run python It will open command line python interpreter Try to import the flask app If its there error, you will get the detailed error...
4
21
0
I use export FLASK_APP=flask_app and then do flask run but I get the error: Error: The file/path provided (flask_app) does not appear to exist. Please verify the path is correct. If app is not on PYTHONPATH, ensure the extension is .py However, the file does exist and is even in the present working directory. Using...
Flask "Error: The file/path provided does not appear to exist" although the file does exist
0.022219
0
0
25,530
41,913,345
2017-01-28T18:34:00.000
0
0
0
0
python,flask,python-import,file-not-found
47,385,908
9
false
1
0
The werkzeug version is not suitable for flask. To address this problem, you need to upgrade the werkzeug, use: $pip install werkzeug --upgrade
4
21
0
I use export FLASK_APP=flask_app and then do flask run but I get the error: Error: The file/path provided (flask_app) does not appear to exist. Please verify the path is correct. If app is not on PYTHONPATH, ensure the extension is .py However, the file does exist and is even in the present working directory. Using...
Flask "Error: The file/path provided does not appear to exist" although the file does exist
0
0
0
25,530
41,913,345
2017-01-28T18:34:00.000
5
0
0
0
python,flask,python-import,file-not-found
54,899,607
9
false
1
0
This could be many reasons. python2 vs python3 issue, pip2 install Flask vs pip3 install Flask issue, and (venv) virtual environment vs local environment issue. In my case, had to do the following to solve the problem: python3 -m venv venv . venv/bin/activate pip3 install Flask export FLASK_APP=flask_app flask run
4
21
0
I use export FLASK_APP=flask_app and then do flask run but I get the error: Error: The file/path provided (flask_app) does not appear to exist. Please verify the path is correct. If app is not on PYTHONPATH, ensure the extension is .py However, the file does exist and is even in the present working directory. Using...
Flask "Error: The file/path provided does not appear to exist" although the file does exist
0.110656
0
0
25,530
41,913,345
2017-01-28T18:34:00.000
7
0
0
0
python,flask,python-import,file-not-found
51,108,431
9
false
1
0
This message will occur if you issue flask run on the command line. Instead use python -m flask run after setting export FLASK_APP and export FLASK_ENV variables. I ran into this issue while following the Flask Tutorial when creating The Application Factory. The instruction does not specify to preface flask run with py...
4
21
0
I use export FLASK_APP=flask_app and then do flask run but I get the error: Error: The file/path provided (flask_app) does not appear to exist. Please verify the path is correct. If app is not on PYTHONPATH, ensure the extension is .py However, the file does exist and is even in the present working directory. Using...
Flask "Error: The file/path provided does not appear to exist" although the file does exist
1
0
0
25,530
41,914,139
2017-01-28T19:51:00.000
-1
0
1
0
python,anaconda
52,901,116
2
false
0
0
One might also consider conda update anaconda. The anaconda meta-package links together certain versions of packages that Continuum Analytics has figured out all play nice together.
1
112
0
How do I reset the root environment of anaconda? There has to be a simple conda reset command that does this. I don't want to reinstall anaconda all over again. I have other virtualenvs that I don't want to overwrite and that will happen if I install anaconda again.
How to reset anaconda root environment
-0.099668
0
0
130,558
41,916,404
2017-01-29T00:29:00.000
1
0
0
0
python,postgresql,memory,redis,memcached
41,916,446
1
true
0
0
I've had tremendous luck with MySQL and SQLAlchemy. 50k writes per day is nothing. I write my logs to it, I log my threads (think about that, I write logs to it and log each thread) and I process 2.5 million records per day, each generating about 100 logs each.
1
0
0
Hi Stack Overflow community, making some architectural decisions & trying to figure out the best strategy to store locations of 50k users who are moving around, in an environment where we care about read & write speed a lot, but don't mind occasionally losing data. Should one use an in-memory datastore like Redis or...
Best database to store locations of users as they move, priority given to read & write speed?
1.2
1
0
180
41,916,497
2017-01-29T00:44:00.000
-1
0
1
0
python,vim,python-mode
41,919,557
1
false
0
0
Append # noqa to the def-line of your function.
1
0
0
Title pretty much says it, but just to be sure: I'm not looking for a way of turning off the mccabe check for all callables (functions, methods), just for specific callables I've decided have a good reason to be complex (like a merge sort). Thanks!
How can I turn off vim python-mode's mccabe completely check for just one function?
-0.197375
0
0
317
41,917,716
2017-01-29T04:52:00.000
2
0
1
0
python,type-hinting,mypy
41,925,579
1
false
0
0
I was missing the file <my-package>/__init__.py, so technically wasn't actually a Python package. It did have an __main__.py file, which was why the command python -m <my-package> still worked.
1
4
0
I am in the directory containing my python package, and running mypy -p <package-name>, but it just errors out with "Can't find package". What am I doing wrong?
Why isn't mypy finding my package?
0.379949
0
0
2,644
41,918,099
2017-01-29T06:00:00.000
0
0
1
0
python,influxdb,influxdb-python
41,990,301
1
false
0
0
So there didn't seem to be a way of doing it (and no answers here). But I solved the problem by performing a query first and if no record found perform an insert. Basically i had to make the scripts figure it out.
1
1
0
I know influx is for measurement type data. But I'm also using it for annotations on certain events. I have scripts that run every minute, that it would be difficult for it to realise an event has already happened. Is there something I can do on the insert to only insert if a new record rather than every time.
Python to influxdb - insert if no record
0
0
0
202
41,918,526
2017-01-29T07:15:00.000
2
1
1
0
python-2.7,localization,internationalization,translation,globalization
41,918,548
2
false
0
0
It simply depends on the information of who is the debug info for? In case of devs only, any dev should know english I think. In case of end users and a multilanguage app, it might be worth the translation. But what are the endusers gonna do with the debug info anyway? In case of multicultural large project, it might b...
2
0
0
I know. Maybe this question isn't in its correspondig area, but as long it's linked with programming (In this case, python2.7), it seems quite logical to me to post it here... In fact, That's the main question. Should it be necessary to translate debug info to other languages? It's quite a trivial question, but it's s...
Does debug info deserves to be translated?
0.197375
0
0
61
41,918,526
2017-01-29T07:15:00.000
2
1
1
0
python-2.7,localization,internationalization,translation,globalization
41,926,272
2
true
0
0
I would base the answer on the following simple question: Is the information to be interpreted by the end user (→ translate) or by the developer (→ don't translate). Normally, debug messages fall squarely into the second category (if they don't, it might be worth looking at the UI design) – but that's for you to decide...
2
0
0
I know. Maybe this question isn't in its correspondig area, but as long it's linked with programming (In this case, python2.7), it seems quite logical to me to post it here... In fact, That's the main question. Should it be necessary to translate debug info to other languages? It's quite a trivial question, but it's s...
Does debug info deserves to be translated?
1.2
0
0
61
41,918,757
2017-01-29T07:53:00.000
4
0
1
0
ios,python-3.x,pyqt5
41,990,062
1
true
0
1
We'll, I'm answering my own question now that I've had some success with pyqtdeploy and iOS. I got to the stage of signing the app but don't have a developer certificate at the moment so it of course failed. I have not yet deployed to the iphone simulator because pyqtdeploy does not prepare the correct architecture whe...
1
5
0
I have been using PyQt for years and would love to be able to use for an iOS app now that both apparently support it. However, I have never had any luck with pyqtdeploy. The tutorial is hard to follow and the build errors difficult to read. Has anyone had any success with this? Or possibly with another PyQt5 deployment...
Has anyone had success deploying pyqt to iOS with pyqtdeploy?
1.2
0
0
5,869
41,918,828
2017-01-29T08:02:00.000
1
0
0
0
java,python-3.x,selenium,memory-management
44,546,508
3
false
1
0
Don't forget drive.close() in your code , if you don't close your driver, you will have a lot instance of Chrome.
1
3
0
I'm using selenium on python 3.5 with chrome webdriver on a ububtu vps, and when I run a very basic script (navigate to site, enter login fields, click), memory usage goes up by ~400mb,and cpu usage goes up to 100%. Are there any things I can do to lower this, or if not, are there any alternatives? I'm testing out sele...
Selenium using too much memory
0.066568
0
1
7,993
41,919,127
2017-01-29T08:50:00.000
0
0
1
0
python-3.x,pygame
41,920,172
2
false
0
1
Installed pygame "pygame-1.9.3-cp35-cp35m-win32.whl" using 'pip' resolved this. Pip installer comes with python 3 and runs with windows command prompt(not in python shell).
1
0
0
I have installed Python 3.5.2 (32-bit) and Python 3.3 pygame -1.9.2a0 on Windows 10. When I run IDLE (python shell) and try to import pygame i get 'No module named pygame' error. I have found sys.path in the shell but pygame is not there. How can I set the variable for pygame OR how I can resolve this problem.
Pygame No module named pygame error in windows 10
0
0
0
1,603
41,920,673
2017-01-29T12:03:00.000
0
0
1
0
python,string,python-3.x,input,line
41,920,859
2
false
0
0
To continue processing of the same command to the next line, add a backslash ('\') before a '\n'
1
1
0
When I am entering a string input that contains line breaks, Python thinks that I have pressed Enter and continues to the next commands. How can I put \n when Enter is pressed, to send the rest to an extra line?
Python 3.5 changing line when there is an Enter in a string
0
0
0
655
41,925,527
2017-01-29T20:21:00.000
0
0
0
0
python,node.js,multithreading,sockets,zeromq
42,099,793
1
false
0
0
There's no obligation to use a single socket for the two way comms. Two is perfectly fine. This means you can have PUB/SUB to broadcast from your NodeJS to your Python code. That's the easy part. Then have a separate PUSH/PULL socket back the other way - the Python does the pushing, the NodeJS does the pulling. One PUS...
1
0
0
I'm learning about the ZeroMQ patterns, and I need to implement the following: NodeJS will send messages to many python threads, but it doesn't need to wait for the answers synchronously, they can come in any order. I know that the publish/subscribe pattern solves it in one way: it can send to many, but how do the pyth...
ZeroMQ: publish to many, receive replys in any order
0
0
0
68
41,926,293
2017-01-29T21:43:00.000
0
1
1
1
python,windows,raspberry-pi3
41,926,309
3
false
0
0
Yes! Python code is mostly platform independent. Only some specific libs must be compiled in the Maschine. These should be installed using pip (if needed). More info in Google.
2
0
0
I would like to use my Raspberry Pi for some programming. (never done it before, I want to get into Python.) If I can transfer my programs yo my Windows 8.1 computer and run them there also, that would be perfect. Can I do that? Thanks!
Will Python programs created on a Raspberry Pi running Raspbian work on a Windows 8.1 machine?
0
0
0
34
41,926,293
2017-01-29T21:43:00.000
0
1
1
1
python,windows,raspberry-pi3
41,927,152
3
false
0
0
Short answer: mostly yes, but it depends. Obviously, the Raspberry Pi specific libraries for controlling its peripherals won't work on ms-windows. Your Pi is probably running a Linux distribution that has package management and comes with a functioning toolchain. That means that installing (python) packages and librari...
2
0
0
I would like to use my Raspberry Pi for some programming. (never done it before, I want to get into Python.) If I can transfer my programs yo my Windows 8.1 computer and run them there also, that would be perfect. Can I do that? Thanks!
Will Python programs created on a Raspberry Pi running Raspbian work on a Windows 8.1 machine?
0
0
0
34
41,926,321
2017-01-29T21:46:00.000
0
0
1
0
python,python-idle
41,982,964
1
true
0
0
I am not aware that IDLE ever didn't restart when running a editor file, so that would have to have been several years ago. I will think about it as a new feature though. EDIT: Added in June 2019: On the editor Run menu, Run... Customized opens a dialog with [X] Restart. Uncheck that box and the restart is skipped. EN...
1
1
0
It appears that, in the past, IDLE did not restart (clean the environment) when you ran a script (module). Today, however, this is the case. But for prototyping I would like the environment (assigned variables, imported modules, functions, ...) to survive running different modules (files). Example: I am working on a f...
Run a module in IDLE (Python 3.4) without Restart
1.2
0
0
1,950
41,927,996
2017-01-30T01:45:00.000
-1
0
0
0
python,django,sqlite
41,928,825
2
false
1
0
Each Django model is a class which you import in your app to be able to work with them. To connect models together you can use foreign keys to define relationships, i.e. your Page class will have a foreign key from Book. To store lists in a field, one of the ways of doing it is to convert a list to string using json mo...
1
1
0
I am currently trying to implement a book structure in Django in the model. The structure is as follows Book Class: title pages (this is an array of page objects) bibliography (a dictionary of titles and links) Page Class: title sections (an array of section objects) images (array of image urls) Section Class: title:...
Book Structure in Django
-0.099668
0
0
296
41,933,520
2017-01-30T10:22:00.000
-3
0
1
0
python,bitcoin
43,216,915
1
false
0
0
had this same problem when I was trying initially using minerd with stratum+tcp://wemineltc.com:3333 changed to litcoinpool.org and the problem was solved.
1
0
0
cpuminer (version 2.4.5 win32) error "json-rpc call failed:[-1,"'L' format requires 0 <=number<= 4294967295",null]" how to solve it ? other parameters are "--scrypt -o stratum+tcp://global.wemineltc.com:3333"
cpuminer (version 2.4.5 win32) error "json-rpc call failed:[-1,"'L' format requires 0 <=number<= 4294967295",null]" how to solve it?
-0.53705
0
0
1,361
41,934,355
2017-01-30T11:05:00.000
0
0
0
0
python,html,json,django,rest
41,934,786
1
false
1
0
I don't see the point of using Django HTML Templates in your API endpoint since the whole point of using a REST API is to have the server side and the client side completely independent from one another. So yes, the FAQ items should be delivered as JSON and displayed as you want on the client side.
1
0
0
I'm working on a project that uses Django on the server side and I have a REST(ish) API going. One thing I'm wondering about. Is it considered ok practice to deliver Django HTML templates via the API endpoints? For example, by going to www.rooturl.com, an API endpoint is called and the HTML delivered. Then, when user c...
Django REST Framework and HTML pages
0
0
0
214
41,935,280
2017-01-30T11:53:00.000
0
0
0
0
python,mongodb,optimization,query-optimization,bigdata
45,958,112
3
false
0
0
You can still take advantage of RAM based lookup,and still having extra functionalities that specialized databases provide as compared to a plain hashmap/array in RAM. Your objective with ram based lookups is faster lookups, and avoid network overhead. However both can be achieved by hosting the database locally, or n...
2
16
0
How beneficial will it be to use Python/PHP Nonpersistent array for storing 6GB+ data with 800+ million rows in RAM, rather than using MySQL/MongoDB/Cassandra/BigTable/BigData(Persistence Database) database when it comes to speed/latency in simple query execution? For example, finding one name in 800+ million rows with...
Persistence Database(MySQL/MongoDB/Cassandra/BigTable/BigData) Vs Non-Persistence Array (PHP/PYTHON)
0
1
0
472
41,935,280
2017-01-30T11:53:00.000
4
0
0
0
python,mongodb,optimization,query-optimization,bigdata
41,935,572
3
false
0
0
It should be very big different, around 4-5 orders of magnitude faster. The database stores records in 4KB blocks (usually), and has to bring each such block into memory it needs some milliseconds. Divide the size of your table with 4KB and get the picture. In contrast, corrresponding times for in-memory data are usual...
2
16
0
How beneficial will it be to use Python/PHP Nonpersistent array for storing 6GB+ data with 800+ million rows in RAM, rather than using MySQL/MongoDB/Cassandra/BigTable/BigData(Persistence Database) database when it comes to speed/latency in simple query execution? For example, finding one name in 800+ million rows with...
Persistence Database(MySQL/MongoDB/Cassandra/BigTable/BigData) Vs Non-Persistence Array (PHP/PYTHON)
0.26052
1
0
472
41,935,567
2017-01-30T12:08:00.000
0
0
1
0
python,msbuild,azure-cloud-services,msbuild-task,azure-pipelines
44,496,191
2
false
0
0
I faced with this error when I build new project which have some function have not implement yet. Such as: throw new NotImplementedException();. I just implement this function and the error is throw away.
2
1
0
I'm trying to create build definition for azure cloud services (Microsoft Azure Cloud Service Project) to automate my build process, but I'm getting the below error on the build step in TFS Online. Error WAT070 The referenced assembly was not found D:\a\1\s\Python\WebRole1\WebRole1.exe". Please make sure to build the ...
Error : WAT070 : The referenced assembly was not found. Please make sure to build the role project that produces this assembly before building
0
0
0
1,788
41,935,567
2017-01-30T12:08:00.000
2
0
1
0
python,msbuild,azure-cloud-services,msbuild-task,azure-pipelines
57,997,953
2
true
0
0
I had build errors that for some reason did not appear in the errors list window. I checked the output window and there were two errors towards the end of the build. As soon as these were addressed, the build could complete.
2
1
0
I'm trying to create build definition for azure cloud services (Microsoft Azure Cloud Service Project) to automate my build process, but I'm getting the below error on the build step in TFS Online. Error WAT070 The referenced assembly was not found D:\a\1\s\Python\WebRole1\WebRole1.exe". Please make sure to build the ...
Error : WAT070 : The referenced assembly was not found. Please make sure to build the role project that produces this assembly before building
1.2
0
0
1,788
41,941,537
2017-01-30T17:08:00.000
0
0
0
0
javascript,java,python,google-authenticator,authenticator
41,942,437
1
false
1
0
So I dug a little deeper. This, however, requires I disable and remove the current 2FA from my account. Go disable/remove current 2FA Go enable it again, but remember to grab the secret (it's listed somewhere in the request or on the page) and save it somewhere Find any secret -> One time password "generator" Now I h...
1
0
0
I'm trying to know if this is possible at all. So far it doesn't look that great. Let's imagine I wanted to list all my current Google Authenticator passwords somewhere. That list would update once there's a new set. Is this possible at all? I remember back when Blizzard made their authenticator. You would basically ha...
Google Authenticator passwords duplicated somewhere else?
0
0
1
75
41,942,522
2017-01-30T18:03:00.000
0
0
0
0
python-2.7,traveling-salesman,ant-colony
53,916,150
1
false
0
0
you can start from different nodes and will update the pheromone every time.
1
1
0
If we have 5 cities and 5 ants. Does all ants have to start from the same city? What is the difference if they start from different cities. I am placing the ants at different cities as starting points randomly. I tried using both cases but my results are same. I want to know if it's correct or there is a problem with m...
Ant colony algorithm
0
0
0
947
41,942,799
2017-01-30T18:19:00.000
0
0
1
0
python,python-3.x,copy,paste
70,075,958
2
false
0
0
This is a frustrating issue. The workaround I settled on was to paste into a text editor, then used sed to convert tabs into \t characters. Then copy and paste that into the python interactive shell. For example: Copy and paste 111.222.3.44[tab]80 into a text file that preserves the tabs, and save that file as temp. ...
1
4
0
Today, I tried to paste "ip[tab]port" in a interpreter, the result is "ipport". Example: Copy 111.222.3.44 80(using spaces, here, in lieu of tab) from another source, e.g. Notepad, and paste it into the interactive shell. Unfortunately, when I try this, the [tab] doesn't paste, and the result is:111.222.3.4480 I w...
How to paste Tab character into Python interactive shell
0
0
1
603
41,943,823
2017-01-30T19:21:00.000
1
0
0
0
python,tkinter,progress-bar
41,944,019
3
false
0
1
Tkinter does not have any support for circular progress bars. You will have to draw your own using a series of images, or a drawing on a canvas.
1
4
0
I want to add a Circular progress bar to my Python GUI using Tkinter, but I didn't find any documentation for Circular progress bars with Tkinter. How can I create a Circular progress bar in Tkinter or is this not possible?
Circular progress bar using Tkinter?
0.066568
0
0
6,856
41,946,758
2017-01-30T22:45:00.000
1
0
0
0
python,pandas,matplotlib,ipython,jupyter-notebook
41,947,311
3
false
0
0
To plot only the portion of df1 whose index lies within the index range of df2, you could do something like this: ax = df1.loc[df2.index.min():df2.index.max()].plot() There may be other ways to do it, but that's the one that occurs to me first. Good luck!
1
0
1
Found on S.O. the following solution to plot multiple data frames: ax = df1.plot() df2.plot(ax=ax) But what if I only want to plot where they overlap? Say that df1 index are timestamps that spans 24 hour and df2 index also are timestamps that spans 12 hours within the 24 hours of df1 (but not exactly the same as df1...
Pandas plot ONLY overlap between multiple data frames
0.066568
0
0
3,052
41,951,160
2017-01-31T06:38:00.000
0
0
1
0
python,python-3.x,pandas
63,090,168
2
false
0
0
You can also use SeriesName.map('{:,}'.format)
1
1
1
I have a Series with Name as the index and a number in scientific notation such as 3.176154e+08. How can I convert this number to 317,615,384.61538464 with a thousands separator? I tried: format(s, ',') But it returns TypeError: non-empty format string passed to object.format There are no NaNs in the data. Thanks for ...
Converting scientific notation in Series to commas and thousands separator
0
0
0
6,217
41,951,447
2017-01-31T06:59:00.000
3
0
0
0
python,django,django-models,django-forms
41,951,490
1
true
1
0
Are only the model fields explicitly declared visible in the ModelForm? Yes, generally you don't want to mess with this field, if the user inputs a value for the id field it's very likely to be duplicated so this is something you want django to take care of for you.
1
3
0
I have a model where I didn't specify a primary key and Django generated one for me. Now I create a ModelForm for the model and I have specified id in the fields section of ModelForm. However, in my ModelForm object, the id field is not present. Are only the model fields explicitly declared visible in the ModelForm?
Include auto generated primary key in Django ModelForm fields
1.2
0
0
356
41,951,904
2017-01-31T07:26:00.000
2
0
1
0
python,visual-studio-2017
41,992,828
4
false
0
0
I'm afraid it is not possible as for now. Microsoft removed python tools from VS 2017 a week ago or so. They have written that Python Tools should be available as an add-on "soon".
2
6
0
Does anybody know if it's possible to open old(VS2015) Python solutions and projects in Visual Studio 2017 RC ? VS 2017 cannot load my project, just saying it's incompatible. I was looking for some Python Tools in Modify Visual Studio option but couldn't find anything about it there.
Python Tools Visual Studio 2017 RC
0.099668
0
0
5,258
41,951,904
2017-01-31T07:26:00.000
3
0
1
0
python,visual-studio-2017
42,065,559
4
true
0
0
Microsoft said on January 27, 2017 (build 26127.00) Release Date: January 27, 2017 (build 26127.00) Summary of Updates in this Release Removed the Data Science and Python Development workloads as some of the components weren’t meeting the release requirements, such as translation to non-English languages. They w...
2
6
0
Does anybody know if it's possible to open old(VS2015) Python solutions and projects in Visual Studio 2017 RC ? VS 2017 cannot load my project, just saying it's incompatible. I was looking for some Python Tools in Modify Visual Studio option but couldn't find anything about it there.
Python Tools Visual Studio 2017 RC
1.2
0
0
5,258
41,958,566
2017-01-31T13:14:00.000
0
0
0
0
python-3.x,neural-network,keras,pruning
56,069,261
4
false
0
0
If you set an individual weight to zero won't that prevent it from being updated during back propagation? Shouldn't thatv weight remain zero from one epoch to the next? That's why you set the initial weights to nonzero values before training. If you want to "remove" an entire node, just set all of the weights on that ...
1
21
1
I'm trying to design a neural network using Keras with priority on prediction performance, and I cannot get sufficiently high accuracy by further reducing the number of layers and nodes per layer. I have noticed that very large portion of my weights are effectively zero (>95%). Is there a way to prune dense layers in h...
Pruning in Keras
0
0
0
9,448
41,958,927
2017-01-31T13:32:00.000
1
1
0
0
python,python-2.7
41,958,983
1
true
0
0
How about creating a parent class to all Analysis that will have common attributes (maybe static) and methods? This way when you implement a new AnalysisType you inherit all the parameters and you can change them in a single place.
1
1
0
I am building a program to run several different analyses on a dataset. The different kinds of analysis are each represented by a different kind of analysis tool object (e.g. "AnalysisType1" and "AnalysisType2"). The analysis tools share many of the same parameters. The program is operated from a GUI, in which all the ...
Sharing Parameters between Objects
1.2
0
0
52
41,961,680
2017-01-31T15:48:00.000
2
0
0
0
python-3.x,bokeh
41,967,371
1
false
0
0
Markers (e.g. Triangle) are really meant for use as "scatter" plot markers. With the exception of Circle, they only accept screen dimensions (pixles) for size. If you need triangular regions that scale with data space range changes, your options are to use patch or patches to draw the triangles as polygons (either one ...
1
1
1
I am plotting both wedges and triangles on the same figure. The wedges scale up as I zoom in (I like this), but the triangles do not (I wish they did), presumably because wedges are sized in data units (via radius property) and traingles are in screen units (via size property). Is it possible to switch the triangles t...
scaling glyphs in data units (not screen units)
0.379949
0
0
49
41,964,500
2017-01-31T18:05:00.000
0
0
1
0
python,pip,python-3.5,pymysql,pyc
41,965,456
2
false
0
0
Use cx_freeze, pyinstaller or virtualenv. Or copy code and put in your. Read python import
1
1
0
I'm making a program that uses PyMySql and I'd like people to be able to run my program without going through the manual installation of PyMySql, is there a way I can achieve that? I've already tried compiling to .pyc but that doesn't seem to work, in fact when I uninstall PyMySql it doesn't work anymore. PS: There pro...
If I install modules with pip, how can I make sure other people can run my program without having that module installed?
0
0
0
75
41,964,509
2017-01-31T18:06:00.000
0
0
1
0
python,python-2.7,python-multiprocessing
41,964,789
1
false
0
0
You can do this as follows: Use an instance of the threading.Lock class. Call method acquire to claim exclusive access to your queue from a certain thread and call release to grant other threads access. Since you want to keep gathering your input, copying the whole queue would be probably be to expensive. Probably the...
1
1
0
I want to use the Python 2.7 multiprocessing package to operate on an endless stream of data. A subprocess will constantly receive data via TCP/IP or UDP packets and immediately place the data in a multiprocessing.Queue. However, at certain intervals, say, every 500ms, I only want to operate on a user specified slice...
Handling endless data stream with multiprocessing and Queues
0
0
0
767
41,965,253
2017-01-31T18:48:00.000
3
0
0
1
python,dask
41,965,766
1
true
0
0
Correct, if a task is allocated to one worker and another worker becomes free it may choose to steal excess tasks from its peers. There is a chance that it will steal a task that has just started to run, in which case the task will run twice. The clean way to handle this problem is to ensure that your tasks are idempo...
1
5
1
I'm using the Dask distributed scheduler, running a scheduler and 5 workers locally. I submit a list of delayed() tasks to compute(). When the number of tasks is say 20 (a number >> than the number of workers) and each task takes say at least 15 secs, the scheduler starts rerunning some of the tasks (or executes them ...
Repeated task execution using the distributed Dask scheduler
1.2
0
0
864
41,967,226
2017-01-31T20:49:00.000
0
0
0
0
python,data-modeling
41,968,970
2
true
0
0
I think that the hard part of the problem is that you'll probably want the stimulus (tune) data formatted differently for different queries. What I would think about doing is making a relatively simple data structure for your stimuli (tunes) and add a unique identifier to each unique tune. You could probably get away w...
1
0
1
I'm a researcher studying animal behavior, and I'm trying to figure out the best way to structure my data. I present short musical tunes to animals and record their responses. The Data Each tune consists of 1-10 notes randomly chosen from major + minor scales spanning several octaves. Each note is played for a fixed du...
Database design for complex music analytics
1.2
0
0
65
41,967,742
2017-01-31T21:24:00.000
0
0
0
1
python,google-app-engine,google-cloud-logging
45,255,813
1
true
1
0
Google has in the mean time update the cloud console and debugger, which now does contain full stack traces for Python.
1
2
0
Previously when an error occurred in my application I could find a trace of the entire code to where it happened ( file, line number ). In the Google Cloud console. Right now I only receive a request ID and a timestamp, with no indication of a trace or line number in the code when in the 'logging' window in the Google ...
Google Stackdriver does not show trace
1.2
0
0
264
41,969,597
2017-01-31T23:47:00.000
0
0
0
1
python,django,nginx,redis,wsgi
42,014,392
2
false
1
0
Figured this out after a few days. We were using a django app called django-health-check. It has a component called health_check_celery3 that was in the installed apps. This was having trouble loading while celery was running, and thus causing the whole app to stall. After removing it, celery runs as it should.
1
0
0
I have a django app configured to run behind nginx using uWSGI. On a separate machine I am running celery, and pushing long running tasks from the webserver to the task machine. The majority of the task I/O is outbound http requests, which go on for an hour or more. The task broker is redis. When the tasks run for m...
Nginx non-responsive while celery is running
0
0
0
233
41,970,230
2017-02-01T01:01:00.000
0
0
0
0
python,scikit-learn,random-forest,countvectorizer
47,134,942
1
false
0
0
Well name is a unique thing and an id kind of use sklearn.preprocessing.LabelEncoder after storing the original to a separate list. It will automatically convert the names to a serial number. Also, note if it's a unique thing you should remove names during predicting.
1
1
1
I have a dataframe containing 13 columns. Among 13 three columns are string. One string column is simple male and female which I converted to 1 and 0 using pd.get_dummies() 2nd column contains three different types of string so, easily converted to array using from sklearn.feature_extraction.text import CountVector...
How to deal with name column in Scikitlearn randomforest classifier. python 3
0
0
0
498
41,970,630
2017-02-01T01:46:00.000
2
0
1
1
python-3.x,anaconda,jupyter-notebook
42,047,557
1
true
0
0
Looks like this was fixed in the newest build of anaconda (4.3.0 .1). Unfortunately looks like it requires uninstall and reinstall as the locations seems to have changed drastically (from some subsubsub folder off of AppData to something higher up, under user directory). (But that might be the effect of testing 4.3.0...
1
3
0
After installing anaconda 4.3 64-bit (python 3.6) on windows, and choosing "install for current user only" and "add to path": I noticed that the anaconda program shortcuts don't work on my start menu--they are cut off at the end. Does anyone know how the correct entries should read? (or instead, how to repair the lin...
Anaconda 4.3, 64-bit (python 3.6), leaves incorrect truncated paths in windows Start menu
1.2
0
0
1,261
41,970,795
2017-02-01T02:07:00.000
0
0
1
0
python
41,970,835
13
false
0
0
I think you're right, a for loop would get the job done but might not be the most elegant solution. I've never programmed in Python so I don't know the exact syntax but I could give you a psuedo code rundown of a class that would get the job done.
1
8
0
I was thinking about making a deck of cards for a card game. I could make a list of all of the cards (I don't really care about the suits), but I was wondering if there was a much easier way to do this. cards = ['1','1','1','1'....] I'm positive you could make a for loop to create 4 cards of the same value and add it t...
What is the best way to create a deck of cards?
0
0
0
56,842
41,973,955
2017-02-01T07:14:00.000
1
1
0
0
python-2.7,amazon-web-services,amazon-dynamodb,amazon-dynamodb-streams
42,009,940
2
false
1
0
Option #1 and #2 are almost the same- both do a Scan operation on the DynamoDB table, thereby consuming maximum no. of RCUs. Option #3 will save RCUs, but restoring becomes a challenge. If a record is updated more than once, you'll have multiple copies of it in the S3 backup because the record update will appear twice ...
1
3
0
We are looking for a solution which uses minimum read/write units of DynamoDB table for performing full backup, incremental backup and restore operations. Backup should store in AWS S3 (open to other alternatives). We have thought of few options such as: 1) Using python multiprocessing and boto modules we were able to...
How to perform AWS DynamoDB backup and restore operations by utilizing minimal read/write units?
0.099668
1
0
1,135
41,974,959
2017-02-01T08:21:00.000
1
0
0
0
python,django,apache,ssh
41,976,000
1
true
1
0
Your question is confusing. If you deployed it with Apache, it's running through Apache and not through runserver. You might have additionally started runserver, but that is not what is serving your site.
1
0
0
I recently deployed a Django site on a DigitalOcean droplet through Apache. I did python manage.py runserver through ssh and now the Django site is running. However, it stayed on even after the ssh session expired (understandable because it's still running on the remote server) but how do I shut it down if I need to? A...
Is it normal that the Django site I recently deployed on Apache is always on?
1.2
0
0
48
41,975,993
2017-02-01T09:20:00.000
0
0
1
1
windows,pycharm,python-idle
41,976,142
1
false
0
0
Check os.environ['PATH'] and os.system("echo $PATH"), they should be the same.
1
0
0
In my python script, there is os.system('cmd.exe'). The same script opens a new cmd console when executed with Python IDLE, but not when executed in PyCharm. Any help on this?
why os.system('cmd.exe') in pycharm does not open a new console
0
0
0
658
41,977,176
2017-02-01T10:20:00.000
0
0
0
0
python,http,header,wsgi
42,309,756
1
true
1
0
Yeah, so the problem is, the header is called "If-None-Match", which is not plural.
1
0
0
I'm using Python & WSGI to create a web application. Currently I'm loading the server with wsgiref.simple_server.make_server . However, I'm running into the problem that not all request headers are given to my application. Specifically the header "If-None_matches". The browser is sending it, but I don't get an environm...
Python WSGI missing request header 'If-None-Matches'
1.2
0
0
103
41,987,133
2017-02-01T18:34:00.000
7
0
0
0
python,amazon-web-services,encryption,amazon-s3
41,987,427
1
true
1
0
The "server-side" encryption you have enabled turns on encryption at rest. Which means the file is encrypted while it's sitting on S3. But S3 will decrypt the file before it sends you the data when you download the file. So there is no change to how you handle the file when downloading it if the file is encrypted or no...
1
1
0
I'm using S3 instead of KMS to store essentially a credentials file, and Python to read the file's contents. I manually set the file encrypted by clicking on it in S3, going to Properties - Details - Server Side Encryption:AES-256 And in my Python script, I read the key without making changes from when I read the file ...
Do I ever have to decrypt S3-encrypted files?
1.2
1
0
3,317
41,987,619
2017-02-01T19:03:00.000
1
0
1
0
python,django,python-2.7,python-3.x
41,987,877
1
true
1
0
In a word, no. An app built for Django 1.4 will almost certainly not work on Django 1.9. Django does usually offer backwards compatibility, but only on revision numbers of the minor version. That is, you might expect 1.4.22 to run code written for any 1.4.x without any change necessary, but a 1.5 release would intr...
1
1
0
Currently i am working on django project with python 3.5 and Django 1.9.2. I want to integrated one app(Module) which was build with python 2.7 and Django 1.4 from different django project in my latest project.Can i run two different app with different python and Django in single Django project.
How to run two different python version in single Django project?
1.2
0
0
82
41,988,762
2017-02-01T20:08:00.000
0
1
0
0
python,selenium,automated-tests
71,752,003
2
false
0
0
Anybody using this guide (as of April 2022) will need to update to the following: https://www.googleapis.com/pagespeedonline/v5/runPagespeed?url={YOUR_SITE_URL}/&filter_third_party_resources=true&locale=en_US&screenshot=false&strategy=desktop&key={YOUR_API_KEY} The difference is the "/v2/" needs to be replaced with "/v...
1
1
0
Is there a way to automate checking Google Page Speed scores?
How to automate Google PageSpeed Insights tests using Python
0
0
1
2,435