Q_Id
int64
2.93k
49.7M
CreationDate
stringlengths
23
23
Users Score
int64
-10
437
Other
int64
0
1
Python Basics and Environment
int64
0
1
System Administration and DevOps
int64
0
1
DISCREPANCY
int64
0
1
Tags
stringlengths
6
90
ERRORS
int64
0
1
A_Id
int64
2.98k
72.5M
API_CHANGE
int64
0
1
AnswerCount
int64
1
42
REVIEW
int64
0
1
is_accepted
bool
2 classes
Web Development
int64
0
1
GUI and Desktop Applications
int64
0
1
Answer
stringlengths
15
5.1k
Available Count
int64
1
17
Q_Score
int64
0
3.67k
Data Science and Machine Learning
int64
0
1
DOCUMENTATION
int64
0
1
Question
stringlengths
25
6.53k
Title
stringlengths
11
148
CONCEPTUAL
int64
0
1
Score
float64
-1
1.2
API_USAGE
int64
1
1
Database and SQL
int64
0
1
Networking and APIs
int64
0
1
ViewCount
int64
15
3.72M
39,659,748
2016-09-23T11:32:00.000
1
1
1
0
0
python,eclipse,python-3.x,autocomplete
0
39,773,761
0
1
0
true
0
0
If you are using PyDev, make sure that interpreter grammar is set to 3.0 (right click project -> Properties -> PyDev - Interpreter/Grammar)
1
0
0
0
I changed the interpreter for my python projects from 2.x to 3.5 recently. The code interpretes correctly with the 3.5 version. I noticed that the autocompletion function of Eclipse still autocompletes as if I am using 2.x Python version. For example: print gets autocompleted without parenthesis as a statement and not ...
force eclipse to use Python 3.5 autocompletion
0
1.2
1
0
0
82
39,665,029
2016-09-23T15:59:00.000
1
1
0
0
0
python
0
39,665,400
0
2
0
false
0
0
shutil is a very usefull thing to use when copying files. I once needed to have a python script that moved all .mp3 files from a directory to a backup, deleted the original directory, created a new once, and moved the .mp3 files back in. shutil was perfect for thise. The formatting for the command is how @Kieran has st...
1
1
0
0
I am very new to Python. I am curious to how I would be able to copy some files from my directory to another Users directory on my computer using python script? And would I be correct in saying I need to check the permissions of the users and files? So my question is how do I send files and also check the permissions a...
Python sending files from a user directory to another user directory
0
0.099668
1
0
0
639
39,679,167
2016-09-24T17:38:00.000
3
0
0
0
0
python,django
0
39,679,214
0
1
0
false
1
0
You're confusing two different things here. A class can easily have an attribute that is a list which contains instances of another class, there is nothing difficult about that. (But note that there is no way in which a Message should extend MessageBox; this should be composition, not inheritance.) However then you go...
1
0
0
0
I have been having trouble using django. Right now, I have a messagebox class that is suppose to hold messages, and a message class that extends it. How do I make it so messagebox will hold messages? Something else that I cannot figure out is how classes are to interact. Like, I have a user that can send messages. Shou...
How can a class hold an array of classes in django
0
0.53705
1
0
0
121
39,691,679
2016-09-25T20:46:00.000
1
0
0
0
0
python,django,django-models
0
39,692,799
0
1
0
true
1
1
If I understood your description correctly, you want a relationship where there can be many emailWidget or TextWidget for one instance of widgetManager. What you can do in this case is add a ForeignKey field for widgetManager to emailWidget and TextWidget. This way, you can have many instances of the widgets while the...
1
0
0
0
I have a model called widgetManager and 2 widget models called emailWidget and TextWidget. Now a single instance of widgetManager can have multiple instances of emailWidget and TextWidget. How can this be achieved with the following in mind Till now i only have two but there can be more in future The order of widget i...
Proper model defination in django for a widget manager
0
1.2
1
0
0
27
39,691,860
2016-09-25T21:08:00.000
1
0
1
0
0
python-2.7,pip
0
43,962,413
1
2
0
false
0
0
install pip for Python2.7 with easy_install: sudo easy_install-2.7 pip now you can use pip for the same specific version of Python: sudo pip2.7 install BeautifulSoup
1
2
0
0
I am using macOS Sierra 10.12 and after I upgraded my OS I can no longer install packages for python 3 using pip. Before I used to use pip for python2 and pip3 for python 3 as I have both versions of Python. But now I can no longer use pip to install libraries for python2. Can anyone help me how can I change my defaul...
pip command by default using python 3...how to change it to python 2?
0
0.099668
1
0
0
4,506
39,694,646
2016-09-26T04:15:00.000
0
0
0
0
0
python,c++,boost,fortran,gfortran
0
39,716,307
0
1
0
false
0
0
I built Boost.Python libraries 1.61.0 from source for Python 2.7 using VC 14.0. Then used those in the build process for Netgen (again using VC 14.0) and pointed to the Python 2.7 library and include directories (as opposed to Python 3.5). This has thus far worked in Python 2.7 with my existing code.
1
2
0
0
I have a Python 2.7 project that has thus far been using gfortran and MinGW to build extensions. I use MinGW because it seems to support write statements and allocatable arrays in the Fortran code while MSVC does not. There is another project I would like to incorporate into my own (Netgen) but it is currently set up f...
Building Fortran extension for Python 3.5 or C extension for 2.7
0
0
1
0
0
168
39,713,433
2016-09-26T22:34:00.000
1
0
1
0
1
python,keyboard,spyder
0
60,240,641
0
2
0
false
0
0
Set this configuration in Spyder: Run > Run Configuration Per File > Execute In An External System Terminal In my experience "msvcrt.kbhit" only works in CMD.
1
2
0
0
Has anyone come across a way to emulate kbhit() in the Spyder environment on Windows? Somehow the development environment gets between the Python program and the keyboard, so any simple way of doing it (i.e. msvcrt.kbhit()) does not work.
How to make kbhit() work in the Spyder environment
0
0.099668
1
0
0
478
39,713,540
2016-09-26T22:46:00.000
1
0
0
0
0
python,tcp,scapy
0
40,023,525
0
1
0
true
0
0
You can not directly write the TCP options field byte per byte, however you can either: write your entire TCP segment byte per byte: TCP("\x01...\x0n") add an option to Scapy's code manually in scapy/layers/inet.py TCPOptions structure These are workarounds and a definitive solution to this would be to implement a by...
1
0
0
0
I want to read and write custom data to TCP options field using Scapy. I know how to use TCP options field in Scapy in "normal" way as dictionary, but is it possible to write to it byte per byte?
Read/Write TCP options field
1
1.2
1
0
1
402
39,715,472
2016-09-27T03:22:00.000
0
0
0
0
0
python,opencv,video,overlay
0
39,716,115
0
2
0
false
0
0
What you need are 2 Mat objects- one to stream the camera (say Mat_cam), and the other to hold the overlay (Mat_overlay). When you draw on your main window, save the line and Rect objects on Mat_overlay, and make sure that it is not affected by the streaming video When the next frame is received, Mat_cam will be update...
2
1
1
0
I am currently working in Python and using OpenCV's videocapture and cv.imshow to show a video. I am trying to put an overlay on this video so I can draw on it using cv.line, cv.rectangle, etc. Each time the frame changes it clears the image that was drawn so I am hoping if I was to put an overlay of some sort on top o...
How to put an overlay on a video
0
0
1
0
0
1,160
39,715,472
2016-09-27T03:22:00.000
0
0
0
0
0
python,opencv,video,overlay
0
39,721,387
0
2
0
false
0
0
I am not sure that I have understood your question properly.What I got from your question is that you want the overlay to remain on your frame, streamed from Videocapture, for that one simple solution is to declare your "Mat_cam"(camera streaming variable) outside the loop that is used to capture frames so that "Mat_c...
2
1
1
0
I am currently working in Python and using OpenCV's videocapture and cv.imshow to show a video. I am trying to put an overlay on this video so I can draw on it using cv.line, cv.rectangle, etc. Each time the frame changes it clears the image that was drawn so I am hoping if I was to put an overlay of some sort on top o...
How to put an overlay on a video
0
0
1
0
0
1,160
39,722,984
2016-09-27T11:02:00.000
1
0
1
0
0
python,numpy,compilation
0
39,728,900
0
3
0
false
0
0
Python can execute functions written in Python (interpreted) and compiled functions. There are whole API docs about writing code for integration with Python. cython is one of the easier tools for doing this. Libraries can be any combination - pure Python, Python plus interfaces to compiled code, or all compiled. Th...
1
4
0
0
Trying to understand whether python libraries are compiled because I want to know if the interpreted code I write will perform the same or worse. e.g. I saw it mentioned somewhere that numpy and scipy are efficient because they are compiled. I don't think this means byte code compiled so how was this done? Was it compi...
Are Python modules compiled?
0
0.066568
1
0
0
2,959
39,726,921
2016-09-27T14:09:00.000
0
0
1
0
0
python
0
39,727,471
0
1
0
false
0
0
Let's start from the second point: if the list you store in memory is larger than the available ram, the computer starts using the hd as ram and this severely slow down everything. The optimal way of outputting in your situation is fill the ram as much as possible (always keeping enough space for the rest of the softwa...
1
0
0
0
Say I have a data file of size 5GB in the disk, and I want to append another set of data of size 100MB at the end of the file -- Just simply append, I don't want to modify nor move the original data in the file. I know I can read the hole file into memory as a long long list and append my small new data to it, but it's...
modify and write large file in python
0
0
1
0
0
1,079
39,738,872
2016-09-28T05:42:00.000
2
0
1
0
0
python,compilation,comparison,abstract-syntax-tree
0
39,738,985
0
2
0
false
0
0
One approach would be to count then number of functions, objects, keywords possibly grouped into categories such as branching, creating, manipulating, etc., and number variables of each type. Without relying on the methods and variables being called the same name(s). For a given problem the similar approaches will ten...
1
2
0
0
Many would want to measure code similarity to catch plagiarisms, however my intention is to cluster a set of python code blocks (say answers to the same programming question) into different categories and distinguish different approaches taken by students. If you have any idea how this could be achieved, I would appre...
How to measure similarity between two python code blocks?
0
0.197375
1
0
0
960
39,759,680
2016-09-29T00:44:00.000
0
0
1
0
0
python
0
39,778,818
0
2
0
false
0
0
think i figured it out. Apparently SLES 11.4 does not include the development headers in the default install from their SDK for numpy 1.8. And of course they don't offer matplotlib along with a bunch of common python packages. The python packages per the SLES SDK are the system default are located under/usr/lib64/pyth...
1
0
1
0
My system is SLES 11.4 having python 2.6.9. I know little about python and have not found where to download rpm's that give me needed python packages. I acquired numpy 1.4 and 1.11 and I believe did a successful python setup.py build followed by python setup.py install on numpy. Going from memory I think this installed...
manually building installing python packages in linux so they are recognized
1
0
1
0
0
44
39,768,925
2016-09-29T11:23:00.000
2
0
0
0
0
python,tkinter,raspberry-pi,touchscreen,raspberry-pi3
0
39,770,561
0
2
0
true
0
1
There is always a widget with the keyboard focus. You can query that with the focus_get method of the root window. It will return whatever widget has keyboard focus. That is the window that should receive input from your keypad.
1
1
0
0
I'm making a program on the Raspberry Pi with a touchscreen display. I'm using Python Tkinter that has two entry widgets and one on screen keypad. I want to use the same keypad for entering data on both entry widgets. Can anyone tell me how can i check if an entry is selected? Similar like clicking on the Entry using...
Check if Entry widget is selected
0
1.2
1
0
0
1,831
39,771,998
2016-09-29T13:42:00.000
0
0
1
0
0
python,linux,pycharm
0
39,772,172
0
2
0
false
0
0
Click on the top-right tab with your project name, then go Edit Configurations and there you can change the interpreter.
2
0
0
0
I haven't been able to find anything and I am not sure if this is the place I should be asking... But I want to include the path to my interpreter in every new project I create. The reason being is that I develop locally and sync my files to a linux server. It is annoying having to manually type #! /users/w/x/y/z/bi...
Is it possible to include interpreter path (or set any default code) when I create new python file in Pycharm?
1
0
1
0
0
59
39,771,998
2016-09-29T13:42:00.000
1
0
1
0
0
python,linux,pycharm
0
39,772,630
0
2
0
true
0
0
You should open File in the main menu and click Default Settings, collapse the Editor then click File and Code Templates, in the Files tab click on the + sign and create a new Template, give the new template a name and extension, in the editor box put your template content, in your case #! /users/w/x/y/z/bin/python app...
2
0
0
0
I haven't been able to find anything and I am not sure if this is the place I should be asking... But I want to include the path to my interpreter in every new project I create. The reason being is that I develop locally and sync my files to a linux server. It is annoying having to manually type #! /users/w/x/y/z/bi...
Is it possible to include interpreter path (or set any default code) when I create new python file in Pycharm?
1
1.2
1
0
0
59
39,773,544
2016-09-29T14:49:00.000
0
0
0
0
0
python,openpyxl
0
39,774,351
0
2
0
false
0
0
I'm not sure what you mean by "text box". In theory you can add pretty much anything covered by the DrawingML specification to a chart but the practice may be slightly different. However, there is definitely no built-in API for this so you'd have to start by creating a sample file and working backwards from it.
1
2
0
1
I'm trying to add a text box to a chart I've generated with openpyxl, but can't find documentation or examples showing how to do so. Does openpyxl support it?
Adding a text box to an excel chart using openpyxl
0
0
1
1
0
3,047
39,779,412
2016-09-29T20:27:00.000
0
0
0
0
0
python,unix
1
39,813,792
0
2
0
true
0
0
I have find the solution. It might because I am using Spyder from anaconda. As long as I use "\" instead of "\", python can recognize the location.
1
0
1
0
I am trying to write the file to my company's project folder which is unix system and the location is /department/projects/data/. So I used the following code df.to_csv("/department/projects/data/Test.txt", sep='\t', header = 0) The error message shows it cannot find the locations. how to specify the file location in U...
how to export data to unix system location using python
0
1.2
1
0
0
43
39,780,715
2016-09-29T22:02:00.000
2
0
0
0
0
python,html,django,pdf-generation,weasyprint
0
39,792,862
0
1
0
false
1
0
PDF is not built to be responsive, it is built to display the same no matter where it is viewed. As @alxs pointed out in a comment, there are a few features that PDF viewing applications have added to simulate PDFs being responsive. Acrobat's Reflow feature is the best example of this that I am aware of and even it str...
1
1
0
0
how to generate a responsive PDF with Django?. I want to generate a PDF with Django but i need that is responsive, that is to say, the text of the PDF has that adapted to don't allow space empty. for example to a agreement this change in the text, then, i need to adapt the to space of paper leaf.
how to generate a responsive PDF with Django?
0
0.379949
1
0
0
252
39,801,748
2016-10-01T00:19:00.000
2
0
1
0
0
python
0
39,801,759
0
3
0
false
0
0
Examine the text preceding your desired position and count the number of \n characters.
1
0
0
0
If I have a text that I've read into memory by using open('myfile.txt').read(), and if I know a certain location in this file, say, at character 10524, how can I find the line number of that location?
In Python, how can I get a line number corresponding to a given character location?
0
0.132549
1
0
0
156
39,805,237
2016-10-01T09:56:00.000
1
0
0
0
0
python,postgresql,web-scraping,scrapy
0
39,805,342
0
1
0
false
1
0
For example: I have a site with 100 pages and 10 records each. So I scrape page 1, and then go to page 2. But on fast growing sites, at the time I do the request for page 2, there might be 10 new records, so I would get the same items again. Nevertheless I would get all items in the end. BUT next time scraping this sit...
1
0
0
0
I want to scrape a lot (a few hundred) of sites, which are basically like bulletin boards. Some of these are very large (up to 1.5 million) and also growing very quickly. What I want to achieve is: scrape all the existing entries scrape all the new entries near real-time (ideally around 1 hour intervals or less) For ...
How to go about incremental scraping large sites near-realtime
0
0.197375
1
0
1
265
39,805,675
2016-10-01T10:46:00.000
-1
1
0
0
0
python,nltk
1
39,810,288
0
4
0
true
0
0
The Problem is raised probably because you don't have a default directory created for your ntlk downloads. If you are on a Windows Platform, All you need to do is to create a directory named "nltk_data" in any of your root directory and grant write permissions to that directory. The Natural Language Tool Kit initially ...
1
1
0
0
I have problem on import nltk. I configured apache and run some sample python code, it worked well on the browser. The URL is : /localhost/cgi-bin/test.py. When I import the nltk in test.py its not running. The execution not continue after the "import nltk" line.And it gives me that error ValueError: Could not find a d...
ValueError: Could not find a default download directory of nltk
0
1.2
1
0
0
1,011
39,836,893
2016-10-03T17:11:00.000
0
0
0
0
0
python,automation,imacros
0
39,837,450
0
1
0
false
1
0
There is a python package called mechanize. It helps you automate the processes that can be done on a browser. So check it out.I think mechanize should give you all the tools required to solve the problem.
1
0
0
0
I have a .csv file with a list of URLs I need to extract data from. I need to automate the following process: (1) Go to a URL in the file. (2) Click the chrome extension that will redirect me to another page which displays some of the URL's stats. (3) Click the link in the stats page that enables me to download the dat...
Automate file downloading using a chrome extension
0
0
1
0
1
282
39,851,566
2016-10-04T11:51:00.000
12
0
1
0
0
python,python-2.7,python-3.x,pip
0
39,852,126
0
8
0
true
0
0
You will have to use the absolute path of pip. E.g: if I installed python 3 to C:\python35, I would use: C:\> python35\Scripts\pip.exe install packagename Or if you're on linux, use pip3 install packagename If you don't specify a full path, it will use whichever pip is in your path.
4
15
0
0
I am using Windows 10. Currently, I have Python 2.7 installed. I would like to install Python 3.5 as well. However, if I have both 2.7 and 3.5 installed, when I run pip, how do I get the direct the package to be installed to the desired Python version?
Using pip on Windows installed with both python 2.7 and 3.5
0
1.2
1
0
0
31,750
39,851,566
2016-10-04T11:51:00.000
1
0
1
0
0
python,python-2.7,python-3.x,pip
0
39,852,599
0
8
0
false
0
0
The answer from Farhan.K will work. However, I think a more convenient way would be to rename python35\Scripts\pip.exe to python35\Scripts\pip3.exe assuming python 3 is installed in C:\python35. After renaming, you can use pip3 when installing packages to python v3 and pip when installing packages to python v2. Without...
4
15
0
0
I am using Windows 10. Currently, I have Python 2.7 installed. I would like to install Python 3.5 as well. However, if I have both 2.7 and 3.5 installed, when I run pip, how do I get the direct the package to be installed to the desired Python version?
Using pip on Windows installed with both python 2.7 and 3.5
0
0.024995
1
0
0
31,750
39,851,566
2016-10-04T11:51:00.000
-1
0
1
0
0
python,python-2.7,python-3.x,pip
0
48,870,834
0
8
0
false
0
0
I tried many things , then finally pip3 install --upgrade pip worked for me as i was facing this issue since i had both python3 and python2.7 installed on my system. mind the pip3 in the beginning and pip in the end. And yes you do have to run in admin mode the command prompt and make sure if the path is set properl...
4
15
0
0
I am using Windows 10. Currently, I have Python 2.7 installed. I would like to install Python 3.5 as well. However, if I have both 2.7 and 3.5 installed, when I run pip, how do I get the direct the package to be installed to the desired Python version?
Using pip on Windows installed with both python 2.7 and 3.5
0
-0.024995
1
0
0
31,750
39,851,566
2016-10-04T11:51:00.000
-1
0
1
0
0
python,python-2.7,python-3.x,pip
0
53,885,123
0
8
0
false
0
0
1-open command prompt and change direction using the command cd C:\Python35\Scripts 2- write the command pip3 install --upgrade pip 3- close the command prompt and reopen it again to return to the default direction and use the command pip3.exe install package_name to install any package you want
4
15
0
0
I am using Windows 10. Currently, I have Python 2.7 installed. I would like to install Python 3.5 as well. However, if I have both 2.7 and 3.5 installed, when I run pip, how do I get the direct the package to be installed to the desired Python version?
Using pip on Windows installed with both python 2.7 and 3.5
0
-0.024995
1
0
0
31,750
39,861,106
2016-10-04T20:22:00.000
3
0
1
0
0
python,matplotlib,ipython,jupyter
0
50,086,042
0
2
0
false
0
0
%matplotlib auto should switch to the default backend.
2
7
0
0
Well, I know I can use %matplotlib inline to plot inline. However, how to disable it? Sometime I just want to zoom in the figure that I plotted. Which I can't do on a inline-figure.
How to DISABLE Jupyter notebook matplotlib plot inline?
0
0.291313
1
0
0
9,341
39,861,106
2016-10-04T20:22:00.000
1
0
1
0
0
python,matplotlib,ipython,jupyter
0
39,861,256
0
2
0
true
0
0
Use %matplotlib notebook to change to a zoom-able display.
2
7
0
0
Well, I know I can use %matplotlib inline to plot inline. However, how to disable it? Sometime I just want to zoom in the figure that I plotted. Which I can't do on a inline-figure.
How to DISABLE Jupyter notebook matplotlib plot inline?
0
1.2
1
0
0
9,341
39,880,906
2016-10-05T18:06:00.000
0
0
1
0
0
python,package,environment-variables
0
39,918,729
0
1
0
false
0
0
I think I'll just detail in the readme file what to insert and where. I tried to find a difficult solution when it was really simple and straightforward
1
0
0
0
I created a python package for in-house use which relies upon some environmental variables (namely, the user and password to enter an online database). for my company, the convenience of installing a package rather than having it in every project is significant as the functions inside are used in completely separate p...
In-house made package and environmental variables link
0
0
1
0
0
23
39,882,504
2016-10-05T19:49:00.000
2
0
0
0
1
python,django,django-tables2
0
39,882,505
0
2
1
true
1
0
Im posting this as a future reference for myself and other who might have the same problem. After searching for a bit I found out that django-tables2 was sending a single query for each row. The query was something like SELECT * FROM "table" LIMIT 1 OFFSET 1 with increasing offset. I reduced the number of sql calls ...
1
3
0
0
im using django-tables2 in order to show values from a database query. And everythings works fine. Im now using Django-dabug-toolbar and was looking through my pages with it. More out of curiosity than performance needs. When a lokked at the page with the table i saw that the debug toolbar registerd over 300 queries fo...
django-tables2 flooding database with queries
0
1.2
1
1
0
348
39,891,681
2016-10-06T08:54:00.000
1
0
0
0
1
python,bitmap,wxpython
0
39,901,257
0
1
0
true
0
1
Take a look at the wx.lib.agw.supertooltip module. It should help you to create a tooltip-like window that displays custom rich content. As for triggering the display of the tooltip, you can catch mouse events for the tree widget (be sure to call Skip so the tree widget can see the events too) and reset a timer each ti...
1
0
0
0
So i'm programming python program that uses wxPython for UI, with wx.TreeCtrl widget for selecting pictures(.png) on selected directory. I would like to add hover on treectrl item that works like tooltip, but instead of text it shows bitmap picture. Is there something that already allows this, or would i have to create...
wxpython treectrl show bitmap picture on hover
0
1.2
1
0
0
160
39,906,167
2016-10-06T21:51:00.000
0
0
0
0
0
java,python,rest,api
0
39,906,371
0
2
0
false
1
0
Furthermore, in the future you might want to separate them from the same machine and use network to communicate. You can use http requests. Make a contract in java of which output you will provide to your python script (or any other language you will use) send the output as a json to your python script, so in that way ...
1
1
0
0
I have a Java process which interacts with its REST API called from my program's UI. When I receive the API call, I end up calling the (non-REST based) Python script(s) which do a bunch of work and return me back the results which are returned back as API response. - I wanted to convert this interaction of UI API -> JA...
Inputs on how to achieve REST based interaction between Java and Python?
0
0
1
0
1
2,327
39,906,620
2016-10-06T22:31:00.000
1
0
1
0
1
python,file,binaryfiles,file-writing
0
39,906,690
0
1
0
false
0
0
What you're doing wrong is assuming that it can be done. :-) You don't get to insert and shove the existing data over; it's already in that position on disk, and overwrite is all you get. What you need to do is to mark the insert position, read the remainder of the file, write your insertion, and then write that remai...
1
0
0
0
I've tried to do this using the 'r+b', 'w+b', and 'a+b' modes for open(). I'm using with seek() and write() to move to and write to an arbitrary location in the file, but all I can get it to do is either 1) write new info at the end of the file or 2) overwrite existing data in the file. Does anyone know of some other...
how do I insert data to an arbitrary location in a binary file without overwriting existing file data?
0
0.197375
1
0
0
56
39,940,303
2016-10-09T05:21:00.000
0
0
1
0
1
python,windows-server-2008-r2,msvcr100.dll
0
54,189,960
0
1
0
false
0
0
The "Failed to write all bytes for (random DLL name)" error generally indicates that the disk is full. Would be nice if Microsoft had bothered to add an extra sentence indicating such, but this is usually the problem. If your disk isn't full, then it may be a permissions issue -- make sure the user you're running the p...
1
0
0
0
I made a python console exe. It cannot work on windows2008 R2 server. I copy MSVCR100.dll and MSVCP100.dll from another computer onto the dir containing the exe file. It has been working correctly a long time. Today, when start it show that "Failed to write all bytes for MSVCR100.dll" I don't know what caused it and ho...
Failed to write all bytes for MSVCR100.dll
0
0
1
0
0
2,132
39,949,845
2016-10-10T00:18:00.000
0
0
1
0
1
python-3.x
0
39,950,009
0
6
0
false
0
0
Figured it out, if you just started python then you probably did not add python to your path. To do so uninstall python and then reinstall it. This time click "add python to path" at the bottom of the install screen.
5
4
0
0
I just downloaded Python and Visual Studio. I'm trying to test the debugging feature for a simple "Hello World" script and I'm receiving this error: Failed to launch the Python Process, please validate the path 'python' followed by this in the debug console: Error: spawn python ENOENT Could someone please help me ...
Visual Studio Python "Failed to launch the Python Process, please validate the path 'python'' & Error: spawn python ENOENT
0
0
1
0
0
27,825
39,949,845
2016-10-10T00:18:00.000
1
0
1
0
1
python-3.x
0
43,901,308
0
6
0
false
0
0
Simply restart your VB studio code. Those show that some packages have been downloaded but not yet installed until reboot it.
5
4
0
0
I just downloaded Python and Visual Studio. I'm trying to test the debugging feature for a simple "Hello World" script and I'm receiving this error: Failed to launch the Python Process, please validate the path 'python' followed by this in the debug console: Error: spawn python ENOENT Could someone please help me ...
Visual Studio Python "Failed to launch the Python Process, please validate the path 'python'' & Error: spawn python ENOENT
0
0.033321
1
0
0
27,825
39,949,845
2016-10-10T00:18:00.000
1
0
1
0
1
python-3.x
0
43,998,477
0
6
0
false
0
0
Add python path by following these steps. 1. Go to uninstall a program. 2. Go to Python 3.6.1 (this is my python version). Select and click on Uninstall/change. 3.Click on Modify. 4. Click next > In advanced options > tick add Python to environment variable. Click install. Restart VS code.
5
4
0
0
I just downloaded Python and Visual Studio. I'm trying to test the debugging feature for a simple "Hello World" script and I'm receiving this error: Failed to launch the Python Process, please validate the path 'python' followed by this in the debug console: Error: spawn python ENOENT Could someone please help me ...
Visual Studio Python "Failed to launch the Python Process, please validate the path 'python'' & Error: spawn python ENOENT
0
0.033321
1
0
0
27,825
39,949,845
2016-10-10T00:18:00.000
2
0
1
0
1
python-3.x
0
44,814,591
0
6
0
false
0
0
For those who are having this error after the recent (May-June of 2017) update of Visual Studio Code. Your old launch.json file might be causing this issue, due to the recent updates of launch.json file format and structure. Try to delete launch.json file in the .vscode folder. The .vscode folder exists in your workspa...
5
4
0
0
I just downloaded Python and Visual Studio. I'm trying to test the debugging feature for a simple "Hello World" script and I'm receiving this error: Failed to launch the Python Process, please validate the path 'python' followed by this in the debug console: Error: spawn python ENOENT Could someone please help me ...
Visual Studio Python "Failed to launch the Python Process, please validate the path 'python'' & Error: spawn python ENOENT
0
0.066568
1
0
0
27,825
39,949,845
2016-10-10T00:18:00.000
7
0
1
0
1
python-3.x
0
41,195,399
0
6
0
false
0
0
Do not uninstall! 1) Go to location that you installed the program. *example: C:\Program Files (x86)\Microsoft VS Code copy the location. 2) right click on computer> properties >Advanced System Settings> Environment variables > under user variables find "path" click> edit> under variable value: go to the end of the li...
5
4
0
0
I just downloaded Python and Visual Studio. I'm trying to test the debugging feature for a simple "Hello World" script and I'm receiving this error: Failed to launch the Python Process, please validate the path 'python' followed by this in the debug console: Error: spawn python ENOENT Could someone please help me ...
Visual Studio Python "Failed to launch the Python Process, please validate the path 'python'' & Error: spawn python ENOENT
0
1
1
0
0
27,825
39,958,650
2016-10-10T12:46:00.000
0
0
1
0
1
python,multithreading,console-application
0
39,958,943
0
1
0
true
0
0
In a console, standard output (produced by the running program(s)) and standard input (produced by your keypresses) are both sent to screen, so they may end up all mixed. Here your thread 1 writes 1 x by line every second, so if your take more than 1 second to type HELLO then that will produce the in-console output tha...
1
0
0
0
I have a problem with console app with threading. In first thread i have a function, which write symbol "x" into output. In second thread i have function, which waiting for users input. (Symbol "x" is just random choice for this question). For ex. Thread 1: while True: print "x" time.sleep(1) Th...
One of threads rewrites console input in Python
0
1.2
1
0
0
201
39,969,168
2016-10-11T01:29:00.000
2
0
0
0
0
python,machine-learning,recommendation-engine,data-science
0
40,001,529
0
1
0
true
1
0
I would keep it simple and separate: Your focus is collaborative filtering, so your recommender should generate scores for the top N recommendations regardless of location. Then you can re-score using distance among those top-N. For a simple MVP, you could start with an inverse distance decay (e.g. final-score = cf-sc...
1
0
0
0
I am currently building a recommender engine in python and I faced the following problem. I want to incorporate collaborative filtering approach, its user-user variant. To recap, its idea is that we have an information on different users and which items they liked (if applicable - which ratings these users assigned to ...
Recommender engine in python - incorporate custom similarity metrics
0
1.2
1
0
0
114
39,970,515
2016-10-11T04:29:00.000
0
0
0
0
0
python,matplotlib
0
39,971,118
0
3
0
false
0
0
It seems to me heatmap is the best candidate for this type of plot. imshow() will return u a colored matrix with color scale legend. I don't get ur stretched ellipses problem, shouldnt it be a colored squred for each data point? u can try log color scale if it is sparse. also plot the 12 classes separately to analyze...
2
1
1
0
I have a sparse matrix X, shape (6000, 300). I'd like something like a scatterplot which has a dot where the X(i, j) != 0, and blank space otherwise. I don't know how many nonzero entries there are in each row of X. X[0] has 15 nonzero entries, X[1] has 3, etc. The maximum number of nonzero entries in a row is 16. Atte...
Python: Plot a sparse matrix
0
0
1
0
0
2,877
39,970,515
2016-10-11T04:29:00.000
0
0
0
0
0
python,matplotlib
0
40,127,976
0
3
0
false
0
0
plt.matshow also turned out to be a feasible solution. I could also plot a heatmap with colorbars and all that.
2
1
1
0
I have a sparse matrix X, shape (6000, 300). I'd like something like a scatterplot which has a dot where the X(i, j) != 0, and blank space otherwise. I don't know how many nonzero entries there are in each row of X. X[0] has 15 nonzero entries, X[1] has 3, etc. The maximum number of nonzero entries in a row is 16. Atte...
Python: Plot a sparse matrix
0
0
1
0
0
2,877
39,972,261
2016-10-11T07:25:00.000
0
0
1
0
0
python,pandas,upgrade,arcmap
1
39,972,738
1
1
0
false
0
0
I reinstalled python again directly from python.org and then installed pandas which seems to work. I guess this might stop the ArcMap version of python working properly but since I'm not using python with ArcMap at the moment it's not a big problem.
1
0
1
0
I recently installed ArcGIS10.4 and now when I run python 2.7 programs using Idle (for purposes unrelated to ArcGIS) it uses the version of python attached to ArcGIS. One of the programs I wrote needs an updated version of the pandas module. When I try to update the pandas module in this verion of python (by opening co...
How to update pandas when python is installed as part of ArcGIS10.4, or another solution
0
0
1
0
0
212
39,989,680
2016-10-12T02:41:00.000
0
0
0
0
0
python
0
39,989,752
0
1
0
false
0
0
I think you're going to have to extract your own snippets by opening and reading the url in the search result.
1
1
0
0
I am now trying the python module google which only return the url from the search result. And I want to have the snippets as information as well, how could I do that?(Since the google web search API is deprecated)
How can I get the google search snippets using Python?
0
0
1
0
1
167
40,001,836
2016-10-12T14:55:00.000
1
0
1
0
0
python,python-3.5,projects-and-solutions,spyder
0
44,144,280
0
1
0
false
0
0
There is an easy solution to this, at least for simple cases and as of May 2017 (Spyder 3.1.2): Create a new empty project in Spyder 3. The new project directory will then have a subdirectory named ".spyproject" with these files in it: codestyle.ini, encoding.ini, vcs.ini, workspace.ini. Copy the entire .spyproject s...
1
1
0
0
The past few months, I've been working on a project using Spyder2 IDE with Python 2.7. However, now I'm being instructed to look into ways of translating the program from Python 2.7 to Python 3.5, which means I'm using Anaconda3 now instead of Anaconda2, and that means I'm using Spyder3 as the default IDE instead of Sp...
Import Project from Spyder2 to Spyder3
0
0.197375
1
0
0
505
40,013,849
2016-10-13T06:34:00.000
0
1
0
0
0
php,python,web,messagebox
0
40,015,293
0
1
0
false
0
0
I think you will need to read about pub/sub for messaging services. For php, you can use libraries such as redis. So for e.g, user1 subscribe to topic1, any user which publish to topic1, user1 will be notified, and you can implement what will happen to the user1.
1
0
0
0
I am running a website where user can send in-site message (no instantaneity required) to other user, and the receiver will get a notification about the message. Now I am using a simple system to implement that, detail below. Table Message: id content receiver sender Table User: some info notification some info Whe...
How to implement a message system?
0
0
1
0
0
123
40,020,767
2016-10-13T12:17:00.000
2
0
0
0
0
python,apache-spark,ibm-cloud,ibm-cloud-plugin
0
40,021,035
0
1
0
true
0
0
In a Python notebook: !pip install <package> and then import <package>
1
0
1
0
1) I have Spark on Bluemix platform, how do I add a library there ? I can see the preloaded libraries but cant add a library that I want. Any command line argument that will install a library? pip install --package is not working there 2) I have Spark and Mongo DB running, but I am not able to connect both of them. ...
Add a library in Spark in Bluemix & connect MongoDB , Spark together
0
1.2
1
1
0
106
40,033,066
2016-10-14T00:21:00.000
2
0
0
1
0
python,linux
0
40,033,097
0
1
0
true
0
0
You can set up the script to run via cron, configuring time as @reboot With python scripts, you will not need to compile it. You might need to install it, depending on what assumptions your script makes about its environment.
1
2
0
0
I've been learning Python for a project required for work. We are starting up a new server that will be running linux, and need a python script to run that will monitor a folder and handle files when they are placed in the folder. I have the python "app" working, but I'm having a hard time finding how to make this scr...
Run a python application/script on startup using Linux
0
1.2
1
0
0
87
40,046,656
2016-10-14T15:18:00.000
1
0
1
1
0
python,python-2.7,centos
0
40,047,015
1
1
0
false
0
0
Replacing 2.7.6 with 2.7.12 would be fine using the procedure you linked. There should be no real problems with libraries installed with pip easy_install as the version updates are minor. Worst comes to worst and there is a library conflict it would be because the python library used for compiling may be different and...
1
0
0
0
I run a script on several CentOS machines that compiles Python 2.7.6 from source and installs it. I would now like to update the script so that it updates Python to 2.7.12, and don't really know how to tackle this. Should I do this exactly the same way, just with source code of higher version, and it will overwrite the...
Updating Python version that's compiled from source
0
0.197375
1
0
0
240
40,071,987
2016-10-16T15:27:00.000
1
0
1
0
0
python,linux,virtualenv,archlinux-arm,pacman-package-manager
0
40,072,017
0
1
0
true
0
0
You can create the virtualenv with the --system-site-packages switch to use system-wide packages in addition to the ones installed in the stdlib.
1
0
0
0
My system is Archlinux. My project will use NumPy, and my project is in a virtual environment created by virtualenv. As it is difficult to install NumPy by pip, I install it by Pacman: sudo pacman -S python-scikit-learn But how can I use it in virtualenv?
How to use the NumPy installed by Pacman in virtualenv?
0
1.2
1
0
0
492
40,099,001
2016-10-18T03:26:00.000
1
0
0
0
0
python-xarray
1
40,099,554
1
1
0
false
0
0
Use "conda install xarray==0.8.0" if you're using anaconda, or "pip install xarray==0.8.0" otherwise.
1
1
1
0
I am reading other's pickle file that may have data type based on xarray. Now I cannot read in the pickle file with the error "No module named core.dataset". I guess this maybe a xarray issue. My collaborator asked me to change my version to his version and try again. My version is 0.8.2, and his version 0.8.0. So how ...
how to install previous version of xarray
0
0.197375
1
0
0
999
40,109,065
2016-10-18T13:02:00.000
1
0
0
0
0
python,openerp,odoo-9
0
40,124,695
0
1
0
true
1
0
Your smart button on partners should use a new action, like the button for customer or vendor bills. This button definition should include context="{'default_partner_id': active_id} which will allow to change the partner filter later on, or the upcoming action definition should include the partner in its domain. The ac...
1
2
0
0
In accounting -> Customer Invoices, there is a filter called Overdue. Now I want to calculate the overdue payments per user and then display it onto the customer form view. I just want to know how can we apply the condition of filter in python code. I have already defined a smart button to display it with a (total invo...
Display Sum of overdue payments in Customer Form view for each customer
1
1.2
1
0
0
270
40,120,312
2016-10-19T00:48:00.000
-3
0
0
1
1
python,django,celery,amazon-elastic-beanstalk,celerybeat
0
40,166,437
0
2
0
true
1
0
In case someone experience similar issues: I ended up switching to a different Queue / Task framework for django. It is called django-q and was set up and working in less than an hour. It has all the features that I needed and also better Django integration than Celery (since djcelery is no longer active). Django-q is ...
2
13
0
0
I am trying to figure out the best way to structure a Django app that uses Celery to handle async and scheduled tasks in an autoscaling AWS ElasticBeanstalk environment. So far I have used only a single instance Elastic Beanstalk environment with Celery + Celerybeat and this worked perfectly fine. However, I want to ha...
Multiple instances of celerybeat for autoscaled django app on elasticbeanstalk
1
1.2
1
0
0
1,251
40,120,312
2016-10-19T00:48:00.000
1
0
0
1
1
python,django,celery,amazon-elastic-beanstalk,celerybeat
0
54,745,929
0
2
0
false
1
0
I guess you could single out celery beat to different group. Your auto scaling group runs multiple django instances, but celery is not included in the ec2 config of the scaling group. You should have different set (or just one) of instance for celery beat
2
13
0
0
I am trying to figure out the best way to structure a Django app that uses Celery to handle async and scheduled tasks in an autoscaling AWS ElasticBeanstalk environment. So far I have used only a single instance Elastic Beanstalk environment with Celery + Celerybeat and this worked perfectly fine. However, I want to ha...
Multiple instances of celerybeat for autoscaled django app on elasticbeanstalk
1
0.099668
1
0
0
1,251
40,126,407
2016-10-19T08:47:00.000
2
0
0
0
0
python,image,image-processing,rgb
0
40,127,791
0
1
0
true
0
0
Per color plane, replace the pixel at (X, Y) by the pixel at (X-1, Y+3), for example. (Of course your shifts will be different.) You can do that in-place, taking care to loop by increasing or decreasing coordinate to avoid overwriting. There is no need to worry about transparency.
1
1
0
0
What I'm trying to do is recreating what is commonly called an "RGB shift" effect, which is very easy to achieve with image manipulation programs. I imagine I can "split" the channels of the image by either opening the image as a matrix of triples or opening the image three times and every time operate just on one cha...
Split and shift RGB channels in Python
1
1.2
1
0
0
1,180
40,141,313
2016-10-19T20:51:00.000
0
1
0
0
0
python,amazon-web-services,aws-lambda
0
56,790,848
0
1
0
true
0
0
In IoT Code, Create a rule for invoking a Lambda to accept JSON data. Then you can do anything with that data.
1
0
0
0
I am Publishing data from Raspberry Pi to AWS IoT and I can see the updates there. Now, I need to get that data into AWS Lambda and connect it to AWS SNS to send a message above a threshold. I know about working with SNS and IoT. I just want to know that how I can get the data from AWS IoT to AWS Lambda ?? Please Hel...
Stream data from AWS IoT to AWS Lambda using Python?
0
1.2
1
0
0
471
40,142,959
2016-10-19T23:10:00.000
5
0
0
0
0
python
0
41,708,567
0
1
0
false
0
0
Just looking for the answer to this myself. gmplot was updated to June 2016 to include a hovertext functionality for the marker method, but unfortunately this isn't available for the scatter method. The enthusiastic user will find that the scatter method simply calls the marker method over and over, and could modify t...
1
3
1
1
I plotted some points on google maps using gmplot's scatter method (python). I want to add some text to the points so when someone clicks on those points they can see the text. I am unable to find any documentation or example that shows how to do this. Any pointers are appreciated.
Add text to scatter point using python gmplot
0
0.761594
1
0
0
8,147
40,148,265
2016-10-20T07:39:00.000
0
0
1
0
0
python,jupyter,jupyter-notebook
0
42,150,227
0
2
0
false
0
0
Did you install python by Anaconda? Try to install under Anaconda2/envs when choosing destination folder, like this: D:/Anaconda2/envs/py3 then"activate py3" by cmd, py3 must be then same name of installation folder
2
0
0
0
I have anaconda2 and anaconda3 installed on windows machine, have no access to internet and administrator rights. How can I switch between python 2 and 3 when starting jupyter? Basic "jupyter notebook" command starts python 2. With internet I would just add environment for python 3 and select it in jupyter notebook aft...
jupyter notebook select python
0
0
1
0
0
1,469
40,148,265
2016-10-20T07:39:00.000
1
0
1
0
0
python,jupyter,jupyter-notebook
0
42,550,420
0
2
0
false
0
0
There's important points to consider: you have to have jupyter notebook installed in each environment you want to run it from if jupyter is only installed in one environment, your notebook will default to that environment no matter from which environment your start it, and you will have no option to change the noteboo...
2
0
0
0
I have anaconda2 and anaconda3 installed on windows machine, have no access to internet and administrator rights. How can I switch between python 2 and 3 when starting jupyter? Basic "jupyter notebook" command starts python 2. With internet I would just add environment for python 3 and select it in jupyter notebook aft...
jupyter notebook select python
0
0.099668
1
0
0
1,469
40,193,388
2016-10-22T14:38:00.000
0
0
0
0
0
python,python-2.7,csv
0
65,651,852
0
8
0
false
0
0
I think the best way to check this is -> simply reading 1st line from file and then match your string instead of any library.
1
11
1
0
I have a CSV file and I want to check if the first row has only strings in it (ie a header). I'm trying to avoid using any extras like pandas etc. I'm thinking I'll use an if statement like if row[0] is a string print this is a CSV but I don't really know how to do that :-S any suggestions?
How to check if a CSV has a header using Python?
0
0
1
0
0
24,553
40,194,021
2016-10-22T15:47:00.000
0
0
1
0
1
python-2.7,spyder
0
41,088,731
0
2
0
false
0
0
You Could try to uninstall that version of spyder and download Anaconda, a free package manager that comes pre-installed with spyder and should work fine, as it did for me as I have windows 7 x64
1
0
0
0
After installing Winpython on windows 7 64 bits, when I launch Spyder I face this: ImportError: No module named encodings Python 2.7.12 Shell works well but Spyder don't. Do you know how to solve this problem? I really appreciate any help you can provide
Can't launch Spyder on windows 7
0
0
1
0
0
609
40,195,188
2016-10-22T17:45:00.000
0
1
0
0
0
php,python,asp.net,raspberry-pi,sms
0
40,195,564
0
1
0
true
0
0
What are the (logical) pitfalls of this scenario? My opion would be to pass the data and the two fields (phoneNumber and SmsType) through a POST request rather then an GET request because you can send more data in an post request and encapsulate it with JSON making it easier to handle the data. What would be a simpler ...
1
0
0
0
Just discovered the amazing Raspberry Pi 3 and I am trying to learn how to use it in one of my projects. Setup: ASP.NET app on Azure. RPi: software: Raspbian, PHP, Apache 2, and MariaDB. has internet access and a web server a configured. 3G dongle for SMS sending, connected to the RPi. Desired scenario: when a s...
Calling Raspberry Pi from ASP.NET to send a SMS remotely
0
1.2
1
0
0
98
40,200,840
2016-10-23T08:04:00.000
1
0
1
0
0
python
0
40,201,438
0
3
0
false
0
0
the else suite is executed after the for terminates normally (not by a break). so it will definitely execute the else statement in your code, because you don't break in the for loop.
1
1
0
0
I am writing a program to search a txt file for a certain line based only on part of the string. If the string isn't found, it should print not found once, but it is printing it multiple times. Even after indenting and using a correct code it still prints:
how do i stop the invalid code message repeating while also occuring at the right time
0
0.066568
1
0
0
41
40,214,784
2016-10-24T09:19:00.000
0
0
0
0
0
python-2.7,tkinter
1
50,161,426
0
2
0
false
0
1
I had the same exact issue with Python-3.4.3. I followed Brice's solution and got halfway there. Not only did I require the -l flags after the -L flag as he suggested, but I discovered my LD_LIBRARY_PATH was inadequate when performing the 'make altinstall'. Be sure to include the same directory in LD_LIBRARY_PATH as us...
1
0
0
0
python2.7 when I import Tkinter, it prompt no module named _tkinter, I don't have the limits of administrator, so I install tcl and tk, then recompile python with --with-tcltk-includes and --with-tcltk-libs parameter, but when running 'make', the error """*** WARNING: renaming "_tkinter" since importing it failed: buil...
undefined symbol: Tk_Init
0
0
1
0
0
648
40,223,807
2016-10-24T17:07:00.000
2
0
1
1
0
python,pycharm,pickle
1
40,224,304
0
1
0
true
0
0
As suggested in the comments, this is most likely because Python is not added to your environment variables. If you do not want to touch your environment variables, and assuming your Python is installed in C:\Python35\, Navigate tp C:\Python35\ in Windows Explorer Go to the address bar and type cmd to shoot up a comm...
1
0
0
0
When trying to install cPickle using pycharm I get this: Command "python setup.py egg_info" failed with error code 1 in C:\Users\Edwin\AppData\Local\Temp\pycharm-packaging\cpickle You are using pip version 7.1.2, however version 8.1.2 is available. You should consider upgrading via the 'python -m pip install --up...
Why can't I install cPickle | Pip needs upgrading?
0
1.2
1
0
0
4,792
40,236,281
2016-10-25T09:29:00.000
0
1
0
0
0
php,python,python-3.x,pip,composer-php
0
40,252,615
0
1
0
true
0
0
I've decided to create separate PHP package for my PHP library, and upload it to a packagist.org, so, user could get it using php composer, but not forced to, as it would be in case of including library.php into python package.
1
0
0
0
I've created tool, that runs as a server, and allow clients to connect to it through TCP, and run some commands. It's written on python 3 Now I'm going to build package and upload it to Pypi, and have conceptual problem. This tool have python client library inside, so, after installation of the package, it'll be possib...
How to include PHP library in Python package (on not do it)
0
1.2
1
0
1
605
40,251,259
2016-10-25T23:19:00.000
1
0
0
0
0
python,python-3.x,tkinter,console
1
40,251,792
0
2
0
true
0
1
You can apply modifiers to the text widget indicies, such as linestart and lineend as well as adding and subtracting characters. The index after the last character is "end". Putting that all together, you can get the start of the last line with "end-1c linestart".
2
3
0
0
I am working on a virtual console, which would use the systems builtin commands and then do the action and display output results on next line in console. This is all working, but how do I get the contents of the last line, and only the last line in the tkinter text widget? Thanks in advance. I am working in python 3. ...
How to get the contents of last line in tkinter text widget (Python 3)
0
1.2
1
0
0
2,994
40,251,259
2016-10-25T23:19:00.000
0
0
0
0
0
python,python-3.x,tkinter,console
1
56,634,803
0
2
0
false
0
1
Test widget has a see(index) method. text.see(END) will scroll the text to the last line.
2
3
0
0
I am working on a virtual console, which would use the systems builtin commands and then do the action and display output results on next line in console. This is all working, but how do I get the contents of the last line, and only the last line in the tkinter text widget? Thanks in advance. I am working in python 3. ...
How to get the contents of last line in tkinter text widget (Python 3)
0
0
1
0
0
2,994
40,266,219
2016-10-26T15:24:00.000
1
0
0
0
0
python,proxy,web-scraping,scrapy,web-crawler
1
40,296,417
0
1
1
true
1
0
Thanks.. I figure out here.. the problem is that some proxy location doesn't work with https.. so I just changed it and now it is working.
1
0
0
0
I am using a proxy (from proxymesh) to run a spider written in scrapy python, the script is running normally when I don't use the proxy, but when I use it, I am having the following error message: Could not open CONNECT tunnel with proxy fr.proxymesh.com:31280 [{'status': 408, 'reason': 'request timeout'}] Any clue abo...
Proxy Error 408 when running a script written in Scrapy Python
0
1.2
1
0
1
497
40,269,957
2016-10-26T18:46:00.000
0
0
0
0
0
python,opencv,tkinter
0
40,271,580
0
1
0
true
0
1
OpenCV window in Tkinter window is not good idea. Both windows use own mainloop (event loop) which can't work at the same time (or you have to use threading) and don't have contact one with other. Probably it is easier to get video frame and display in Tkinter window on Label or Canvas. You can use tk.after(milisecond...
1
0
0
0
I am making a hand controlled media player application in Python and through OpenCV.I want to embed gesture window of OpenCV in Tkinter frame so I can add further attributes to it. Can someone tell how to embed OpenCV camera window into Tkinter frame?
opencv window in tkinter frame
0
1.2
1
0
0
747
40,277,199
2016-10-27T06:01:00.000
0
0
0
0
0
python,flask
0
40,277,255
0
1
0
false
1
0
If you want the user to stay in place, you should send the form using JavaScript asynchronously. That way, the browser won't try to fetch and render a new page. You won't be able to get this behavior from the Flask end only. You can return effectively nothing but the browser will still try to get it and render that not...
1
0
0
0
I have written a python function using flask framework to process some data submitted via a web form. However I don't want to re-render the template, I really just want to process the data and the leave the web form, it the state it was in, when the POST request was created. Not sure how to do this ... any suggestion...
Flask return nothing, instead of having the re-render template
0
0
1
0
0
795
40,284,296
2016-10-27T12:12:00.000
4
0
1
0
0
python,numpy,matrix
0
40,284,356
0
1
0
true
0
0
The Hermitian part is (A + A.T.conj())/2, the anti-hermitian part is (A - A.T.conj())/2 (it is quite easy to prove). If A = B + C with B Hermitian and C anti-Hermitian, you can take the conjugate (I'll denote it *) on both sides, uses its linearity and obtain A* = B - C, from which the values of B and C follow easily.
1
0
1
0
Imagine I have a numpy array in python that has complex numbers as its elements. I would like to know if it is possible to split any matrix of this kind into a hermitian and anti-hermitian part? My intuition says that this is possible, similar to the fact that any function can be split into an even and an uneven part. ...
python: split matrix in hermitian and anti-hermitian part
1
1.2
1
0
0
309
40,287,113
2016-10-27T14:20:00.000
4
0
0
0
1
python,python-3.x,numpy,linear-regression
0
40,293,068
0
1
1
false
0
0
some brief answers 1) Calling statsmodels repeatedly is not the fastest way. If we just need parameters, prediction and residual and we have identical explanatory variables, then I usually just use params = pinv(x).dot(y) where y is 2 dimensional and calculate the rest from there. The problem is that inference, confide...
1
4
1
0
I think I have a pretty reasonable idea on how to do go about accomplishing this, but I'm not 100% sure on all of the steps. This question is mostly intended as a sanity check to ensure that I'm doing this in the most efficient way, and that my math is actually sound (since my statistics knowledge is not completely per...
Fastest way to calculate many regressions in python?
0
0.664037
1
0
0
3,105
40,296,765
2016-10-28T01:49:00.000
1
0
0
0
0
python,nlp,gensim,doc2vec
0
41,733,461
0
1
0
false
0
0
Gensim's Word2Vec/Doc2Vec models don't store the corpus data – they only examine it, in multiple passes, to train up the model. If you need to retrieve the original texts, you should populate your own lookup-by-key data structure, such as a Python dict (if all your examples fit in memory). Separately, in recent versio...
1
1
1
0
I am preparing a Doc2Vec model using tweets. Each tweet's word array is considered as a separate document and is labeled as "SENT_1", SENT_2" etc. taggeddocs = [] for index,i in enumerate(cleaned_tweets): if len(i) > 2: # Non empty tweets sentence = TaggedDocument(words=gensim.utils.to_unicode(i).split(), ...
How to extract words used for Doc2Vec
0
0.197375
1
0
0
1,260
40,309,777
2016-10-28T16:55:00.000
2
0
0
0
0
python,regex,pandas
0
40,310,470
0
2
0
false
0
0
The problem is that the match function does not return True when it matches, it returns a match object. Pandas cannot add this match object because it is not an integer value. The reason you get a sum when you are using 'not' is because it returns a boolean value of True, which pandas can sum the True value and return ...
1
3
1
0
I can find the number of rows in a column in a pandas dataframe that do NOT follow a pattern but not the number of rows that follow the very same pattern! This works: df.report_date.apply(lambda x: (not re.match(r'[0-9]{4}-[0-9]{1,2}-[0-9]{1,2}', x))).sum() This does not: removing 'not' does not tell me how many rows m...
cannot sum rows that match a regular expression in pandas / python
0
0.197375
1
0
0
883
40,321,096
2016-10-29T16:16:00.000
1
0
1
0
0
python,string,format,python-requests,bs4
0
40,321,224
0
1
0
false
0
0
Just use repr() Like: print(repr(<variable with string>))
1
0
0
0
So, I have been playing around with requests and bs4 for a project I'm working on and have managed to return the following in a variable: "---------- Crossways Inn Withy Road West Huntspill Somerset TA93RA 01278783756 www.crosswaysinn.com ----------" This was scraped from a site, using .text function within the bs4 mo...
How do I format the contents of the following variable in Python?
0
0.197375
1
0
0
45
40,321,668
2016-10-29T17:23:00.000
1
0
1
0
0
c++,python-2.7,struct,namedtuple
0
40,336,177
0
2
0
false
0
0
namedtuple is implemented purely in Python. You can see its full source in collections.py. It's very short. The thing to keep in mind is that namedtuple itself is a function which creates a class in the frame in which it is called and then returns this class (not an instance of this class). And it is this returned ...
1
1
0
0
I have searched the internet for hours at this point. Does anyone know how to parse a namedtuple returned from a python function into a struct or just into separate variables. The part I am having trouble with is getting the data out of the returned pointer. I am calling a python function embedded in C++ using the PyOb...
Python NamedTuple to C++ Struct
0
0.099668
1
0
0
1,655
40,323,573
2016-10-29T20:54:00.000
0
0
1
0
0
python,python-2.7
0
40,323,605
0
2
0
false
0
0
Square brackets typically mean that the value is optional. Here, varname refers to the environment variable you want to get and value is an optional value that is return if the environment variable doesn't exist.
1
0
0
0
I have a problem understanding some description of functions in Python. I understand simply functions like os.putenv(varname, value) but I have no idea how to use this: os.getenv(varname[, value]). How to pass arguments to that function, what does those square brackets mean?
How to read Python function documentation
1
0
1
0
0
161
40,329,307
2016-10-30T12:52:00.000
0
0
0
0
0
python,neural-network,concatenation,convolution,keras
0
52,020,891
0
2
0
false
0
0
I do not understand why to have 3 CNNs because you would mostly have the same results than on a single CNN. Maybe you could train faster. Perhaps you could also do pooling and some resnet operation (I guess this could prove similar to what you want). Nevertheless, for each CNN you need a cost function in order to optim...
1
4
1
0
I want to implement a multiscale CNN in python. My aim is to use three different CNNs for three different scales and concatenate the final outputs of the final layers and feed them to a FC layer to take the output predictions. But I don't understand how can I implement this. I know how to implement a single scale CNN. ...
Multiscale CNN - Keras Implementation
0
0
1
0
0
1,527
40,340,100
2016-10-31T10:09:00.000
4
0
0
0
0
python,unit-testing,apache-kafka,kafka-python
0
40,342,318
0
3
0
true
0
0
If you need to verify a Kafka specific feature, or implementation with a Kafka-specific feature, then the only way to do it is by using Kafka! Does Kafka have any tests around its deduplication logic? If so, the combination of the following may be enough to mitigate your organization's perceived risks of failure: uni...
1
11
0
0
We have a message scheduler that generates a hash-key from the message attributes before placing it on a Kafka topic queue with the key. This is done for de-duplication purposes. However, I am not sure how I could possibly test this deduplication without actually setting up a local cluster and checking that it is perfo...
Python: how to mock a kafka topic for unit tests?
0
1.2
1
0
0
11,023
40,341,471
2016-10-31T11:41:00.000
0
0
1
0
0
python,image,python-3.x,python-3.5
0
40,343,522
0
1
0
true
0
1
Is that a homework ? Working with a new target image, as suggested in the comments, is the easiest. But theoretically, assuming your original image is represented as some 2 dimension table of pixels, you could do it without creating a new image: First double both dimensions of the original image (with the original imag...
1
1
0
0
i have to double an image using python, So i think i can replace each pixel of the image with a square formed by 4 pixels how do i can do that and assign to each pixel of the little square different colors?
Double an image using python
0
1.2
1
0
0
1,504
40,370,004
2016-11-01T23:07:00.000
0
0
0
0
0
python-2.7,tensorflow
0
40,370,096
0
1
0
false
0
0
You should just make your label (y) in your reduced sum format (i.e. 3 bits), and train to that label. The neural net should be smart enough to adjust the weights to imitate your reduce_sum logic.
1
0
1
0
I have a question about tensorflow tensor. If I have a NeuralNet like y=xw+b as an example. then x is placeholder([7,7] dims), w is Variable([7,1]) and b is Variable([1,1]) So, y is tensorflow tensor with [7,1] dims. then, in this case. can I make a new tensor like new_y = [tf.reduce_sum(y[0:3]), tf.reduce_sum(y[3:5]),...
Generate new tensorflow tensor according to the element index of original tensor
0
0
1
0
0
54
40,384,700
2016-11-02T16:14:00.000
1
0
1
1
1
python,macos,pip
0
40,386,891
0
1
0
true
0
0
Resolved the problem. Turns out that this is Homebrew's behavior. I must have recently ran brew upgrade and it installed a newer version of python3. It seems that something got weird with re-linking the new python3, so all binaries for the new installs ended up somewhere deep in /usr/local/Cellar/python3. I expect that...
1
1
0
0
Suddenly, my pip install commands stopped installing binaries into /usr/local/bin. I tried to upgrade pip to see if that might be the problem, it was up to date and a forced re-install deleted my /usr/local/pip3 and didn't install it back, so now I have to use python3 -m pip to do any pip operations. I am running OS X ...
pip3 stopped installing executables into /usr/local/bin
0
1.2
1
0
0
1,216
40,389,402
2016-11-02T20:39:00.000
-1
0
0
0
0
python,machine-learning,scikit-learn,k-means
0
40,390,555
0
2
0
false
0
0
Clustering users makes sense. But if your only feature is the rating, I don't think it could produce a useful model for prediction. Below are my assumptions to make this justification: The quality of movie should be distributed with a gaussion distribution. If we look at the rating distribution of a common user, it sh...
1
0
1
0
I have a file called train.dat which has three fields - userID, movieID and rating. I need to predict the rating in the test.dat file based on this. I want to know how I can use scikit-learn's KMeans to group similar users given that I have only feature - rating. Does this even make sense to do? After the clustering ...
Clustering before regression - recommender system
0
-0.099668
1
0
0
733
40,425,856
2016-11-04T15:03:00.000
1
0
0
1
0
javascript,python,cookies,bokeh
0
40,429,660
0
1
0
true
1
0
The cookies idea might work fine. There are a few other possibilities for sharing data: a database (e.g. redis or something else, that can trigger async events that the app can respond to) direct communication between the apps (e.g. with zeromq or similiar) The Dask dashboard uses this kind of communication between r...
1
0
0
0
I have two Bokeh apps (on Ubuntu \ Supervisor \ Nginx), one that's a dashboard containing a Google map and another that's an account search tool. I'd like to be able to click a point in the Google map (representing a customer) and have the account search tool open with info from the the point. My problem is that I don...
Transfer Data from Click Event Between Bokeh Apps
0
1.2
1
0
0
157
40,430,960
2016-11-04T20:07:00.000
2
0
1
0
1
python-2.7,python-3.x,spyder,graphlab
0
40,952,297
0
1
0
true
0
0
Following method will solve this: Open Spyder --> tools --> preferences --> python interpreter --> change from default to custom and select the python executable under gl-env environment. Restart spyder. It will work.
1
2
0
0
I can run my python file with imported functionalities from GraphLab from the Terminal (first use the source activate gl-env and then run the file). So the file and installations are alright in that sense. However, I can't figure out how to run the file directly in Spyder IDE. I only get ImportError: No module named '...
run graphlab from Spyder
0
1.2
1
0
1
391
40,431,073
2016-11-04T20:16:00.000
1
1
1
0
0
python,hashlib,sparse-file
0
40,431,152
0
1
1
false
0
0
The hashlib module doesn't even work with files. You have to read the data in and pass blocks to the hashing object, so I have no idea why you think it would handle sparse files at all. The I/O layer doesn't do anything special for sparse files, but that's the OS's job; if it knows the file is sparse, the "read" operat...
1
0
0
0
I wanted to know how does python hashlib library treat sparse files. If the file has a lot of zero blocks then instead of wasting CPU and memory on reading zero blocks does it do any optimization like scanning the inode block map and reading only allocated blocks to compute the hash? If it does not do it already, what ...
Python hashlib and sparse files
0
0.197375
1
0
0
96
40,438,629
2016-11-05T13:10:00.000
0
0
0
0
0
android,python
0
40,438,672
0
2
0
false
0
0
Your problem is not Android-related definitely. You simply need to educated yourself about networking. Yes, it will cost you some money - you spend them buying few books and some hardware for building home network. After about 3-6-12 months of playing with your home network you will find your question rather simple to ...
1
0
0
0
I have a second laptop running kali linux which is not used at all, meaning it can be running anytime as a server for my application. So what I actually want to do is connect from my application to my server and send some data, on the server run a python program that uses this code and return some data back. I never tr...
Using a server in android to run code
0
0
1
0
1
259
40,442,688
2016-11-05T20:07:00.000
4
1
1
0
0
python
0
40,442,773
0
1
0
true
0
0
When you import a C extension, python uses the platform's shared library loader to load the library and then, as you say, jumps to a function in the library. But you can't load just any library or jump to any function this way. It only works for libs specifically implemented to support python and to functions that are ...
1
1
0
0
In Python ( CPython) we can import module: import module and module can be just *.py file ( with a python code) or module can be a module written in C/C++ ( be extending python). So, a such module is just compiled object file ( like *.so/*.o on the Unix). I would like to know how is it executed by the interpreter exac...
C/C++ module vs python module.
0
1.2
1
0
0
191
40,452,529
2016-11-06T17:50:00.000
3
0
0
0
0
python,django
0
40,452,589
0
3
0
false
1
0
meaning it's really static Use nginx to serve static files. Do not use django. You will setup project structure when it will be required.
2
1
0
0
It is a little oxymoron now that I am making a small Django project that it is hard to decide how to structure such project. Before I will at least will have 10 to 100 apps per project. Now my project is just a website that presents information about a company with no use database, meaning it's really static, with on...
How to structure a very small Django Project?
1
0.197375
1
0
0
318
40,452,529
2016-11-06T17:50:00.000
1
0
0
0
0
python,django
0
40,452,810
0
3
0
false
1
0
Frankly I won't use Django in that case, I would use Flask for such small projects. it's easy to learn and setup a small website. PS: I use Flask in small and large apps!
2
1
0
0
It is a little oxymoron now that I am making a small Django project that it is hard to decide how to structure such project. Before I will at least will have 10 to 100 apps per project. Now my project is just a website that presents information about a company with no use database, meaning it's really static, with on...
How to structure a very small Django Project?
1
0.066568
1
0
0
318
40,454,897
2016-11-06T21:47:00.000
1
0
0
0
0
python,algorithm,path-finding
0
40,458,170
0
4
0
false
0
1
For this problem, simply doing a breadth-first search is enough (Dijkstra and BFS work in same way for unweighted graphs). To ensure that only the chess knight's moves are used, you'll have to define the moves in a proper way. Notice that a chess knight moves two squares to any direction, then one square perpendicular ...
3
1
0
0
I have a problem shown below that wants to find the quickest way to get between any two points by using only the moves of a knight in chess. My first thought was to us the A* algorithm or Dijkstra's algorithm however, I don't know how to make sure only the moves of a knight are used. I would appreciate it if you could ...
Simple algorithm to move from one tile to another using only a chess knight's moves
0
0.049958
1
0
0
1,507
40,454,897
2016-11-06T21:47:00.000
2
0
0
0
0
python,algorithm,path-finding
0
40,458,703
0
4
0
true
0
1
Approach the problem in the following way: Step 1: Construct a graph where each square of the chess board is a vertex. Step 2: Place an edge between vertices exactly when there is a single knight-move from one square to another. Step 3: Apply Dijkstra's algorithm. Dijkstra's algorithm is an algorithm to find the length...
3
1
0
0
I have a problem shown below that wants to find the quickest way to get between any two points by using only the moves of a knight in chess. My first thought was to us the A* algorithm or Dijkstra's algorithm however, I don't know how to make sure only the moves of a knight are used. I would appreciate it if you could ...
Simple algorithm to move from one tile to another using only a chess knight's moves
0
1.2
1
0
0
1,507
40,454,897
2016-11-06T21:47:00.000
1
0
0
0
0
python,algorithm,path-finding
0
41,089,879
0
4
0
false
0
1
While User_Targaryen's answer is the best because it directly answers your question, I would recommend an algebraic solution, if your goal is computing is the delivery of an answer in the shortest amount of time. To shorten the algorithm, use reflections about the x, y, and xy axes, so as to consider only positive (x, ...
3
1
0
0
I have a problem shown below that wants to find the quickest way to get between any two points by using only the moves of a knight in chess. My first thought was to us the A* algorithm or Dijkstra's algorithm however, I don't know how to make sure only the moves of a knight are used. I would appreciate it if you could ...
Simple algorithm to move from one tile to another using only a chess knight's moves
0
0.049958
1
0
0
1,507
40,457,331
2016-11-07T03:20:00.000
1
0
0
0
0
python,information-retrieval,information-extraction
0
40,603,239
0
2
0
false
0
0
Evaluation has two essentials. First one is a test resource with the ranking of documents or their relevancy tag (relevant or not-relevant) for specific queries, which is made with an experiment (like user click, etc. and is mostly used when you have a running IR system), or made through crowd-sourcing. The second esse...
1
3
1
0
i wrote one program to do the information retrieval and extraction. user enter the query in the search bar, the program can show the relevant txt result such as the relevant sentence and the article which consists the sentence. I did some research for how to evaluate the result. I might need to calculate the precision,...
information retrieval evaluation python precision, recall, f score, AP,MAP
0
0.099668
1
0
0
6,407
40,471,132
2016-11-07T17:33:00.000
2
0
0
0
0
python,django
0
40,474,452
0
2
0
true
1
0
Yes, generally POST is a better way of submitting data than GET. There is a bit of a confusion about terminology in Django. While Django is, indeed MVC, models are models, but views are in fact controllers and views are templates. Since you are going to use AJAX to submit and retrieve the data, you don't care about tem...
1
2
0
1
I am working on my first django project which is also my first backend project. In the tutorials/reading I have completed, I haven't come across passing information back to django without a modelform. My intention is to calculate a value on a page using javascript and pass it to django when a user hits a submit button ...
Django - beginner- what is the process for passing information to a view via a url?
0
1.2
1
0
0
47
40,482,242
2016-11-08T08:31:00.000
0
0
0
1
1
python,angularjs,templates,tornado
0
40,517,136
0
1
0
false
1
0
This is not really a Tornado question, as this is simply how Web works. One possible solution is to have only one form, but display its fields so that they look like two forms; in addition, have two separate submit buttons, each with its own name and value. Now, when you click on either button the whole form will be su...
1
0
0
0
I have two forms, when I submit form#1 I get some corresponding file, but when I submit form#2 thenafter, the corresponding file gets shown but form#1 goes empty. So basically I want some thing like a SPA(e.g angular) but I am taking form#1 and form#2 as separate requests routes and each render my index.html every time...
ways to avoid previous reload tornado
0
0
1
0
0
47