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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
40,878,993 | 2016-11-30T01:57:00.000 | 0 | 0 | 1 | 0 | python,exe,anaconda | 40,879,151 | 2 | false | 0 | 0 | Check if a python package called py2exe is installed. Try using that. | 2 | 0 | 0 | I have installed anaconda. How can I convert the .py to .exe by anaconda only without the need to install other things like pyInstaller? I cannot easily install other packages in my company | Convert python to exe by anaconda | 0 | 0 | 0 | 1,567 |
40,878,993 | 2016-11-30T01:57:00.000 | 0 | 0 | 1 | 0 | python,exe,anaconda | 69,865,934 | 2 | false | 0 | 0 | pip install auto-py-to-exe
Install auto-py-to-exe and then
auto-py-to-exe | 2 | 0 | 0 | I have installed anaconda. How can I convert the .py to .exe by anaconda only without the need to install other things like pyInstaller? I cannot easily install other packages in my company | Convert python to exe by anaconda | 0 | 0 | 0 | 1,567 |
40,879,007 | 2016-11-30T01:58:00.000 | 0 | 0 | 1 | 1 | python,pywin32,python-3.6 | 44,041,940 | 2 | false | 0 | 0 | Simply rename
HKEY_LOCAL_MACHINE\SOFTWARE\Python\PythonCore\3.6-32
To:
HKEY_LOCAL_MACHINE\SOFTWARE\Python\PythonCore\3.6
This worked for Python 3.6.1 as well.
Taken from the link above. | 1 | 1 | 0 | I just intstalled python 3.6.0b4 (default, Nov 22 2016) amd64 on my Win 7 computer. When I try to install pywin32-220.win-amd64-py3.6 I get the error message Python version 3.6-32 required, which was not found in the registry.
Python version 3.6-32 sounds like the 32bit version, which seems inappropriate. Perhaps I m... | Python 3.6.0b4 amd64 - pywin32-220.win-amd64-py3.6 can't find python 3.6-32 | 0 | 0 | 0 | 4,192 |
40,879,385 | 2016-11-30T02:45:00.000 | 1 | 0 | 1 | 0 | python,version-control,visual-studio-code | 47,595,986 | 1 | false | 0 | 0 | So, I know this question is a year old, but I just had the same one and did some digging. It looks to me like the objectdb stores information about rope.base.resources.File objects, which include the local path of the file. As such, checking in the ObjectDB doesn't make a lot of sense. The config.py file, on the other ... | 1 | 4 | 0 | The file .vscode/.ropeproject/objectdb has been modified (created) after applying refactoring to some python code (using DonJayamanne's pythonVSCode extension).
Should this objectdb file be excluded from versioning in vscode?
What info does it actually contains? | Should rope objectdb file be excluded from vcs? | 0.197375 | 0 | 0 | 617 |
40,883,050 | 2016-11-30T07:57:00.000 | 1 | 0 | 0 | 0 | python,c++,quantlib,quantlib-swig | 40,915,939 | 1 | false | 0 | 0 | As you found out, you can't just rename the library. When you compiled QuantLib, you chose the "Debug" configuration, which gave you QuantLib-vc140-mt-gd.lib. To get the QuantLib-vc140-mt.lib that Python is asking for, use the "Release" configuration instead. (Incidentally, the compiled library will also be a lot faste... | 1 | 0 | 0 | I had QuantLib 1.9 built already (succeeded), then I tried to install QuantLib-Python from SWIG 1.9. I worked with VS2015,boost_1_62_0 (msvs-14.0 32bit), Anaconda3, QuantLib-1.9, QuantLib-SWIG-1.9 and swigwin-3.0.10,all in the same folder.
When I did "python setup.py build" in dev command prompt for vs2015, I came acro... | QuantLib 1.9 Fatal Error when Build Python | 0.197375 | 0 | 0 | 155 |
40,885,331 | 2016-11-30T10:02:00.000 | -1 | 0 | 0 | 0 | python,refresh,reload | 40,885,562 | 2 | false | 0 | 0 | It's unclear what you mean with "reload", but the normal behavior of Python is that you need to restart the software for it to take a new look on a Python module and reread it. also you cannot add buttons inside a python script ... for that you may need to use HTML or other .. | 1 | 0 | 0 | i am very new to python and I wanted to ask how to reload a Python script, like I want to make a button inside an script that says Reload and when you press on it it refreshes the script, so that I do not have to close it and open it again. Is there any way to do this, I need a step by step guide.
Thanks | How to reload a Python script | -0.099668 | 0 | 0 | 1,588 |
40,887,074 | 2016-11-30T11:22:00.000 | 0 | 1 | 1 | 0 | python-sphinx | 41,701,850 | 1 | false | 0 | 0 | Very easy -- just precede with the following line:
.. highlight:: none
Otherwise Sphinx assumes it is Python code (default)! | 1 | 0 | 0 | I am trying to include in my source .rst file literal producing text like:
::
@reboot myscript
However @reboot appears in boldface. Did not find how to avoid it. | Character @ in a :: literal | 0 | 0 | 0 | 33 |
40,887,631 | 2016-11-30T11:48:00.000 | 0 | 0 | 0 | 0 | python,machine-learning,scikit-learn | 40,947,457 | 1 | false | 0 | 0 | Regarding Problem 1, if you expect the different components of the target value to be independent, you can approach the problem as building a classifier for every component. That is, if the features are F = (F_1, F_2, ..., F_N) and the targets Y = (Y_1, Y_2, ..., Y_N), create a classifier with features F and target Y_1... | 1 | 1 | 1 | Disclaimer: I'm new to the field of Machine Learning, and even though I have done my fair share of research during the past month I still lack deep understanding on this topic.
I have been playing around with the scikit library with the objective of learning how to predict new data based on historic information, and cl... | Multi-Output Classification using scikit Decision Trees | 0 | 0 | 0 | 903 |
40,889,221 | 2016-11-30T13:08:00.000 | 0 | 1 | 0 | 0 | python,gdb,tensorflow,pdb | 68,941,661 | 3 | false | 0 | 0 | Adding on mrry's answer, in today's TF2 environment, the main entry point would be TFE_Execute, this should be where you add the breakpoint. | 1 | 6 | 0 | I am debugging decode_raw_op_test from TensorFlow. The test file is written in python however it executes code from underlying C++ files.
Using pdb, I could debug python test file however it doesn't recognize c++ file. Is there a way in which we can debug underlying c++ code?
(I tried using gdb on decode_raw_op_test b... | Debugging TensorFlow tests: pdb or gdb? | 0 | 0 | 0 | 3,923 |
40,894,487 | 2016-11-30T17:23:00.000 | 3 | 0 | 1 | 0 | python,multithreading,web-crawler,python-multithreading | 40,894,613 | 2 | true | 1 | 0 | The rule of thumb when deciding whether to use threads in Python or not is to ask the question, whether the task that the threads will be doing, is that CPU intensive or I/O intensive. If the answer is I/O intensive, then you can go with threads.
Because of the GIL, the Python interpreter will run only one thread at a... | 1 | 0 | 0 | I've made simple web-crawler with Python. So far everything it does it creates set of urls that should be visited, set of urls that was already visited. While parsing page it adds all the links on that page to the should be visited set and page url to the already visited set and so on while length of should_be_visited ... | Python threading or multiprocessing for web-crawler? | 1.2 | 0 | 1 | 1,352 |
40,894,943 | 2016-11-30T17:47:00.000 | 3 | 1 | 0 | 1 | python,c | 40,895,004 | 1 | true | 0 | 0 | By "Python's read" I assume you mean the read method of file objects. That method is closer in spirit to C's fread: it implements buffering and it tries to satisfy the requested amount, unless that is impossible due to an IO error or end-of-file condition.
If you really need to call the read() function available in man... | 1 | 1 | 0 | C's read:
The read() function shall attempt to read nbyte bytes from the file associated with the open file descriptor, fildes, into the buffer pointed to by buf.
Upon successful completion, these functions shall return a non-negative integer indicating the number of bytes actually read. Otherwise, the functions shal... | What's Python's equivalent to C's read function? | 1.2 | 0 | 0 | 1,069 |
40,896,575 | 2016-11-30T19:25:00.000 | 0 | 1 | 1 | 0 | python | 40,896,863 | 2 | false | 0 | 0 | As lucasnadalutti mentioned, you can access them by importing your module.
In terms of advantages, it can make your main program care less about where the imports are coming from if the imp_mod handles all imports, however, as your program gets more complex and starts to include more namespaces, this approach can get m... | 1 | 2 | 0 | If I were to create a module that was called for example imp_mod.py and inside it contained all (subjectively used) relevant modules that I frequently used.
Would importing this module into my main program allow me access to the imports contained inside imp_mod.py?
If so, what disadvantages would this bring?
I guess a... | What benefits or disadvantages would importing a module that contains 'import' commands? | 0 | 0 | 0 | 2,324 |
40,898,087 | 2016-11-30T20:58:00.000 | 0 | 1 | 0 | 0 | debian,python-3.5,file-sharing | 40,911,268 | 1 | true | 0 | 0 | Probably the easiest to achive, that is also secure is to use sshfs between the servers. | 1 | 0 | 0 | Right, i have a bot that has 2 shards, each on their own server. I need a way to share data between the two, preferably as files, but im unsure how to achieve this.
The bot is completely python3.5 based
The servers are both running Headless Debian Jessie
The two servers arent connected via LAN, so this has to be shari... | Share data between two scripts on different servers | 1.2 | 0 | 1 | 27 |
40,900,493 | 2016-12-01T00:09:00.000 | 2 | 0 | 1 | 0 | python,python-2.7,shell,convention | 48,886,552 | 1 | false | 0 | 0 | I don't think that this is a good python question since the exit code isn't normally used by python unless you're calling one python program from another -- But the general point here remains... The primary consumer of the exit code will be a shell or something that is interested in process management. As such, 0 is ... | 1 | 0 | 0 | According to the Python documentation:
The optional argument arg can be an integer giving the exit status (defaulting to zero), or another type of object. If it is an integer, zero is considered “successful termination” and any nonzero value is considered “abnormal termination” by shells and the like. Most systems req... | Is there a convention for python exit codes? | 0.379949 | 0 | 0 | 4,276 |
40,902,238 | 2016-12-01T03:40:00.000 | 0 | 0 | 0 | 1 | php,python,google-app-engine,ftp | 40,904,184 | 1 | true | 1 | 0 | App Engine projects are not based on server virtual machines. App Engine is a platform as a service, not infrastructure as a service. Your code is packaged up and served on Google App Engine in a manner that can scale easily. App Engine is not a drop-in replacement for your old school web hosting, its quite a bit diffe... | 1 | 0 | 0 | I'm running a PHP app on GCloud (Google App Engine). This app will require users to submit files for processing via FTP. A python cron job with process them.
Given that dev to prod is via the GAE deployment, I'm assuming there is no FTP access to the app folder structure.
How would I go about providing simple one-way F... | GCloud App needs FTP - do I need a VM or can I create an FTP app? | 1.2 | 0 | 0 | 50 |
40,902,567 | 2016-12-01T04:17:00.000 | 0 | 0 | 1 | 1 | python,macos,pip | 40,905,073 | 2 | false | 0 | 0 | Finally got it work after I symlink with brew's python
It was not symlinked into /usr/local
The command is simply brew link python and now which python will point to /usr/local/bin/python | 1 | 1 | 0 | I used brew to install python 2.7 and now my mac have 2 python version
on in /usr/bin/python and another on in /usr/local/Cellar/python/2.7.12_2/
pip installed oursql to /usr/local/lib/python2.7/site-packages
what should i do about it? | How to solve the ImportError: No module named oursql error | 0 | 0 | 0 | 1,134 |
40,902,770 | 2016-12-01T04:39:00.000 | 1 | 0 | 1 | 0 | python,virtualenv | 40,902,817 | 2 | false | 0 | 0 | It is better to have separate environment for every project. Maybe one project needs some package version 1.3 and other needs 1.6. So it is much easier to have an environment for each project then to have one for all.
If you had only one environment you would have to change update(change) packages every time you wante... | 1 | 0 | 0 | I am new to Python. Just installed Anaconda and everything works fine. also the documentation mentioned it is good to configure virtual environment.
Since Anaconda works like a virtual environment, I don't need to configure another virtual environment.
Right or wrong? | Once Anaconda is installed is there no need to install a virtual environment? | 0.099668 | 0 | 0 | 149 |
40,904,368 | 2016-12-01T06:58:00.000 | 0 | 0 | 0 | 0 | python,machine-learning,nlp,pos-tagger | 43,810,812 | 1 | false | 0 | 0 | To calculate accuracy on any dataset, count the number of words (excluding start and stop symbols) that you tagged correctly, and divide by the total number of words (excluding start and stop symbols). | 1 | 1 | 1 | I am implementing the Viterbi Algorithm for POS-Tagger using the Brown-corpus as my data set. Now an important aspect of this NLP task is finding the accuracy of the model. So I really need help as what to implement. It's easier using the nltk toolkit but since I am not using a toolkit, I am stuck on how to determine t... | Finding the accuracy of an HMM model for POS-Tagger | 0 | 0 | 0 | 582 |
40,906,584 | 2016-12-01T09:14:00.000 | 2 | 0 | 1 | 1 | python,eclipse,virtualenv,pydev | 40,910,909 | 1 | false | 0 | 0 | Not sure... by default, any run will get the 'default' interpreter (which is the first interpreter in Preferences > PyDev > Interpreters > Python interpreter -- you may reorder those using the up/down button in that screen).
Now, that's the default, you may also configure to use a different interpreter per project (sel... | 1 | 1 | 0 | I have Python2.7 installed and Python3.5 installed on my windows machine.These are at locations C:\Python27 and C:\Python35-32. Both these are added in System Path environment variables and can be accessed from any directory.
Now i create a virtualenv in Python35-32 directory successfully under a sub-directory CODING_L... | Linking python virtual environment to eclipse | 0.379949 | 0 | 0 | 1,333 |
40,907,731 | 2016-12-01T10:07:00.000 | 1 | 0 | 1 | 0 | python,performance,numpy,processing-efficiency | 40,907,857 | 1 | true | 0 | 0 | Yes, both approaches will have to loop over the values in the two matrices. However, python is dynamically typed such that the body of the loop needs to check the types of the three indices used for iteration, ensure that indexing the two input matrices is supported, determine the type of the values extracted from the ... | 1 | 0 | 1 | When you have two numPy matrix, you could call a dot function to multiply them. Or you could loop through each manually and multiply each value manually. Why and what is the speed difference ? Surely dot function still has to do that but Lower level? | What is the underlying difference between multiplying a matrix and looping through? | 1.2 | 0 | 0 | 35 |
40,915,789 | 2016-12-01T16:33:00.000 | 1 | 0 | 1 | 1 | python,virtualenv | 40,916,124 | 2 | false | 0 | 0 | Since virtualenv copies python completely (including the binary) there is no way to know the exact path it originated from.
However, you can easily find the version by running ./python --version inside the environment's bin folder. | 1 | 0 | 0 | I have an old computer with dozens of old python projects installed, each with its own different virtualenv, and many of which built with different versions of python.
I'd prefer not to have to download these different versions when I create new virtualenvs via virtualenv -p whatever path that version of python has
My ... | Discover path to python version used to make virtualenv | 0.099668 | 0 | 0 | 137 |
40,916,671 | 2016-12-01T17:19:00.000 | 5 | 0 | 1 | 0 | python,set,elements | 40,916,706 | 4 | false | 0 | 0 | Sets are unordered.
The remove command takes the element that you specify.
The pop takes any element. There's no way of predicting which | 3 | 7 | 0 | I'm reading about sets and see terms like "specific" elements and "arbitrary" elements. For example:
"The method remove removes a specific element from a set; pop removes an arbitrary element".
Can someone explain arbitrary elements? | What is an arbitrary element in Python? | 0.244919 | 0 | 0 | 5,252 |
40,916,671 | 2016-12-01T17:19:00.000 | 0 | 0 | 1 | 0 | python,set,elements | 40,916,937 | 4 | false | 0 | 0 | It is the element which is decided by a without any rule or arbiter rather than by a specific rule and structure. In Mathematics X+X = 2X where X is the arbitrary value which not defined in the equation. | 3 | 7 | 0 | I'm reading about sets and see terms like "specific" elements and "arbitrary" elements. For example:
"The method remove removes a specific element from a set; pop removes an arbitrary element".
Can someone explain arbitrary elements? | What is an arbitrary element in Python? | 0 | 0 | 0 | 5,252 |
40,916,671 | 2016-12-01T17:19:00.000 | 0 | 0 | 1 | 0 | python,set,elements | 57,626,194 | 4 | false | 0 | 0 | According to what I've seen, the pop method removes an arbitrary element from the set. In the case of numbers, it removes the lesser positive number
e.g
nums = {4, 3, 3, 3, 3, 4, 5, 6, 1 ,-3}
print(nums)
nums.add(-7)
nums.pop()
print(nums)
RESULT:
{1, 3, 4, 5, 6, -3}
{3, 4, 5, 6, -7, -3} | 3 | 7 | 0 | I'm reading about sets and see terms like "specific" elements and "arbitrary" elements. For example:
"The method remove removes a specific element from a set; pop removes an arbitrary element".
Can someone explain arbitrary elements? | What is an arbitrary element in Python? | 0 | 0 | 0 | 5,252 |
40,919,809 | 2016-12-01T20:30:00.000 | 2 | 0 | 0 | 1 | python,multithreading,asynchronous,couchdb,tornado | 40,922,571 | 1 | true | 0 | 0 | Use AsyncHTTPClient or CurlAsyncHTTPClient. Since the "requests" library is synchronous, it blocks the Tornado event loop during execution and you can only have one request in progress at a time. To do asynchronous networking operations with Tornado requires purpose-built asynchronous network code, like CurlAsyncHTTPCl... | 1 | 0 | 0 | How can I minimize the thread lock with Tornado? Actually, I have already the working code, but I suspect that it is not fully asynchronous.
I have a really long task.
It consists of making several requests to CouchDB to get meta-data and to construct a final link. Then I need to make the last request to CouchDB and s... | Optimize Async Tornado code. Minimize the thread lock | 1.2 | 0 | 0 | 148 |
40,925,079 | 2016-12-02T04:57:00.000 | 1 | 0 | 0 | 0 | android,python,opencv,image-processing | 42,197,304 | 1 | true | 0 | 1 | This process can be done via NDK & OpenCV with Java support in Android Studio.
You need to compile NDK libraries and generate .so files. Then the project will work. | 1 | 1 | 1 | I am working on my OpenCV project with Python which basically recognizes hand gestures. I want to do the same using Android. Is it possible? Is there any way to do so?
I want to recognize very basic hand gestures using my Android device. Is it possible with Python & OpenCV with Android? Also share any other way possibl... | How can I integrate my Python based OpenCV project in Android? | 1.2 | 0 | 0 | 220 |
40,927,573 | 2016-12-02T08:17:00.000 | 0 | 0 | 0 | 0 | jquery,python,json,linux,nfc | 40,928,045 | 1 | true | 1 | 0 | The progress of log in: The user starts the browser and go to your website and instead of manually entering credentials he clicks on the "log in via NFC." Server retains identification session from that IP and date (and maybe other info about client hardware for safe) to the database and "expects" NFC incoming data.
On... | 1 | 0 | 0 | I have a web system where staff can log in with a username and password, then enter data. Is there a way to add the option for users to seamlessly log in just by swiping the card against an NFC scanner? The idea is to have multiple communal PCs people can walk up to and quickly authenticate.
It's important that the us... | Optional NFC login to web based system | 1.2 | 0 | 1 | 1,332 |
40,930,450 | 2016-12-02T10:50:00.000 | 0 | 0 | 0 | 1 | python,python-2.7,subprocess,external,executable | 40,985,274 | 1 | true | 0 | 0 | As I've not had any response I've kind of gone down a different route with this. Rather than relying on the subprocess module to call the exe I have moved that logic out into a batch file. The xmls are still modified by the python script and most of the logic is still handled in script. It's not what ideally would have... | 1 | 0 | 0 | I am currently getting an issue with an external executable crashing when it is launched from a Python script. So far I have tried using various subprocess calls. As well as the more redundant methods such as os.system and os.startfile.
Now the exe doesn't have this issue when I call it normally from the command line o... | External executable crashes when being launched from Python script | 1.2 | 0 | 0 | 146 |
40,937,544 | 2016-12-02T17:10:00.000 | 0 | 0 | 1 | 0 | python,django,web-applications,visual-studio-code,atom-editor | 63,690,785 | 5 | false | 1 | 0 | Nothing worked for me until I had disabled auto reload (--noreload as an argument is crucial, not really sure why it causes problem with debugging) | 1 | 26 | 0 | I'm new at django development and come from desktop/mobile app development with Xcode and related IDE.
I have to use Django and I was wondering if there was an efficient way to debug it using Visual Studio Code (or Atom).
Any help related to Django IDE would be helpful too. | How to use visual studio code to debug django | 0 | 0 | 0 | 35,237 |
40,939,604 | 2016-12-02T19:28:00.000 | 0 | 0 | 0 | 0 | python,facebook | 45,242,035 | 1 | false | 0 | 0 | I faced a similar problem. Now to get the picture of a post you can call
{post-id}?fields=picture,full_picture
where picture returns the url of a thumbnail of the image, while full_picture returns the url of the real image. | 1 | 0 | 0 | I am trying to get pictures from photo type posts on Facebook. I am using Python. I tried to access post_id/picture, but I keep getting:
facebook.GraphAPIError: (#12) picture edge for this type is deprecated for versions v2.3 and higher
Is there any alternative to the picture edge in v2.8? The documentation still lists... | Facebook API get picture from post | 0 | 0 | 1 | 298 |
40,941,476 | 2016-12-02T21:59:00.000 | 69 | 0 | 1 | 0 | python,jupyter-notebook | 40,941,511 | 2 | true | 0 | 0 | Type the fully qualified function name, then type ??. | 1 | 27 | 0 | For example, I want to check the source code of a python library, directly in the notebook, is there a way to do that?
Thank you | How can I check source code of a module in Jupyter notebook? | 1.2 | 0 | 0 | 24,254 |
40,942,308 | 2016-12-02T23:18:00.000 | 0 | 0 | 0 | 0 | python,python-3.x,user-interface,tkinter | 40,949,445 | 2 | false | 0 | 1 | @Manny102030
I got this code. basically what i want is to insert a Node in a Tree with the value that the user inputs in the Tkinter. I dont know if the value the user is inputting is actually being inserted because i cant figure how to call the function that i created to print the Tree (the function is also in the cla... | 1 | 0 | 0 | I have a code in Python that has various options such as Add, Remove, Search etc...
Can i make a GUI using Tkinter that basically when it runs, it shows buttons with all the options, then when you click for example "Add" it appears a input box for the user to Add a new value, then goes back to the initial page etc... I... | Python TKinter Menu with Options | 0 | 0 | 0 | 883 |
40,942,391 | 2016-12-02T23:25:00.000 | 2 | 0 | 0 | 0 | python,machine-learning | 40,942,885 | 2 | false | 0 | 0 | Since there's an unknown function that generates the output, it's a regression problem. Neural network with 2 hidden layers and e.g. sigmoid can learn any arbitrary function. | 2 | 2 | 1 | I need some orientation for a problem I’m trying to solve. Anything would be appreciated, a keyword to Google or some indication !
So I have a list of 5 items. All items share the same features, let’s say each item has 3 features for the example.
I pass the list to a ranking function which takes into account the featur... | ML model to predict rankings (arbitrary ordering of a list) | 0.197375 | 0 | 0 | 1,288 |
40,942,391 | 2016-12-02T23:25:00.000 | 1 | 0 | 0 | 0 | python,machine-learning | 40,947,117 | 2 | true | 0 | 0 | It could be treated as a regression problem with the following trick: You are given 5 items with 5 feature vectors and the "black box" function outputs 5 distinct scores as [1, 2, 3, 4, 5]. Treat these as continuous values. So, you can think of your function as operating by taking five distinct input vectors x1, x2, x3... | 2 | 2 | 1 | I need some orientation for a problem I’m trying to solve. Anything would be appreciated, a keyword to Google or some indication !
So I have a list of 5 items. All items share the same features, let’s say each item has 3 features for the example.
I pass the list to a ranking function which takes into account the featur... | ML model to predict rankings (arbitrary ordering of a list) | 1.2 | 0 | 0 | 1,288 |
40,943,923 | 2016-12-03T03:21:00.000 | 2 | 0 | 0 | 0 | python,flask | 58,601,756 | 2 | false | 1 | 0 | As far as routing goes, Pluggable Views (aka class-based views) is far more superior than Blueprints, which are just a bunch of functions with routes decorators.
In Pluggable Views paradigm, it facilitates code reuse code by organizing view logics in classes and subclass them. URL routes are registered with app.add_url... | 1 | 2 | 0 | What's the difference between PluggableViews and Blueprint in Python Flask? | Difference between Pluggable Views and Blueprint in Python Flask | 0.197375 | 0 | 0 | 3,114 |
40,947,387 | 2016-12-03T11:46:00.000 | 0 | 0 | 1 | 1 | python,memory,memory-management | 40,947,523 | 3 | false | 0 | 0 | You can just open task manager and look how much ram does it take. I use Ubuntu and it came preinstalled. | 1 | 0 | 0 | I am running python program using Linux operating system and i want to know how much total memory used for this process. Is there any way to determine the total memory usage ? | total memory used by running python code | 0 | 0 | 0 | 494 |
40,948,991 | 2016-12-03T14:45:00.000 | 1 | 0 | 0 | 1 | python,linux,debian | 40,949,085 | 1 | true | 0 | 0 | You gave nohup one single argument containing spaces and quotes, and it failed to find a command with that name. Split it so the command is openvpn, with two more arguments (you'll probably find the extra quotes around the last argument shouldn't be there either). Sometimes this job is left to a shell, as with the syst... | 1 | 0 | 0 | For some strange reason when i run a python script with:
subprocess.Popen(["nohup", "openvpn --config '/usr/local/etc/openvpn/pia_openvpn/AU Melbourne.ovpn'"])
I get
nohup: failed to run command ‘openvpn --config '/usr/local/etc/openvpn/pia_openvpn/AU Melbourne.ovpn'’: No such file or directory
I can run openvpn --conf... | nohup: failed to run command | 1.2 | 0 | 0 | 1,657 |
40,949,988 | 2016-12-03T16:34:00.000 | 0 | 0 | 0 | 0 | python,machine-learning,computer-vision,neural-network | 45,639,855 | 2 | false | 0 | 0 | It is good that you have created your own program. I would suggest you to keep experimenting with basic problems, such as MNIST by adding more hidden layers, plotting variation of loss with training iterations using different learning rates, etc.
In general, the learning rate should not be kept high initially when the ... | 2 | 1 | 1 | I have built a system where the neural network can change size (number of and size of hidden layers, etc). When training it with a learning rate of 0.5, 1 hidden layer of 4 neurons, 2 inputs and 1 output, it successfully learns the XOR and AND problem (binary inputs, etc). Works really well.
When I then make the struc... | how to define an issue with neural networks | 0 | 0 | 0 | 24 |
40,949,988 | 2016-12-03T16:34:00.000 | 0 | 0 | 0 | 0 | python,machine-learning,computer-vision,neural-network | 40,950,086 | 2 | false | 0 | 0 | A quick advice may be to solve an intermediate task (e.g. to use your own 5x5 ASCII "pictures" of digits), to have more neurons in the hidden layer, to reduce the data set for quicker simulation, to compare your implementation to other custom implementations in your programming language. | 2 | 1 | 1 | I have built a system where the neural network can change size (number of and size of hidden layers, etc). When training it with a learning rate of 0.5, 1 hidden layer of 4 neurons, 2 inputs and 1 output, it successfully learns the XOR and AND problem (binary inputs, etc). Works really well.
When I then make the struc... | how to define an issue with neural networks | 0 | 0 | 0 | 24 |
40,954,342 | 2016-12-04T01:14:00.000 | 3 | 0 | 1 | 0 | python | 40,954,421 | 2 | true | 0 | 0 | Best is to use PYTHONPATH. Set it to the path where your common modules are found, before running Python. Then you can just do import my_funcs for example. | 1 | 0 | 0 | now I have a folder named my_funcs which have __init__.py and some .py files containing some functions and classes I wrote that I want to use for several projects.
So I want to know the best practice for these projects to direct import from this folder.
one solution is to sys.path.append('.../my_funcs'), in this case ... | Best practice for common functions used by several Python projects | 1.2 | 0 | 0 | 78 |
40,957,229 | 2016-12-04T09:31:00.000 | 1 | 0 | 1 | 0 | python,python-3.x,nltk | 40,957,243 | 1 | false | 0 | 0 | Tokenize the string into words.
Use set membership operators, which are quick, to eliminate leading/trailing tokens while they match the list of stopwords.
If the next step really needs a string, then concatenate the list of words back into one with the idiomatic ' '.join(your_list) | 1 | 1 | 0 | Working using NLTK and I am prototyping a project I have in mind. I come from PHP so Python is a little unknown for me.
I have a list of stopwords and an n-word string, n being between 1 and 4.
I want to clean that string by trimming both ends of any stopwords. If I need to retest the string after I remove a stopword b... | How to remove stopwords at the beginning or the end of a string in Python? | 0.197375 | 0 | 0 | 324 |
40,957,552 | 2016-12-04T10:17:00.000 | 1 | 0 | 1 | 1 | python,python-multiprocessing | 40,957,775 | 1 | true | 0 | 0 | Yes, you understand correctly.
According to documentation, this method only needed to maintain the multiprocessing module in working condition under frozen exe under Windows. | 1 | 2 | 0 | Am I understand correctly, that multiprocessing.freeze_support() need only to compile .py script to .exe in windows? Or is it used in other things? | Freeze_support what is needed? | 1.2 | 0 | 0 | 1,868 |
40,957,941 | 2016-12-04T11:06:00.000 | 0 | 0 | 0 | 0 | python-3.x,tkinter | 54,459,365 | 1 | false | 0 | 1 | You can use PyAutoGUI and Tkinter to:
Get current mouse position relative to desktop coordinates.
Minimize tkinter window or drag it out of the screen.
Simulate click event when the window will be hidden.
Return back tkinter window.
It should work but I'm not sure how fast would it be. | 1 | 0 | 0 | I'm trying to write a semi transparent click trough program to use like onion skin over my 3d application.
the one thing I couldn't find googling is how to make the window click trough. is there an attribute or something for it in tkinter? or maybe some way around it? | python 3.4 tkinter, click trough window | 0 | 0 | 0 | 50 |
40,958,107 | 2016-12-04T11:28:00.000 | 1 | 0 | 0 | 1 | python,postgresql,mutex,kubernetes,distributed-system | 40,968,608 | 1 | true | 0 | 0 | A completely different approach would be to run a (web) server that executes the job functionality. At a high level, the idea is that the webserver can contact this new job server to execute functionality. In addition, this new job server will have an internal cron to trigger the same functionality every 2 hours.
There... | 1 | 0 | 0 | I have a Python program that I am running as a Job on a Kubernetes cluster every 2 hours. I also have a webserver that starts the job whenever user clicks a button on a page.
I need to ensure that at most only one instance of the Job is running on the cluster at any given time.
Given that I am using Kubernetes to run t... | Ensuring at most a single instance of job executing on Kubernetes and writing into Postgresql | 1.2 | 1 | 0 | 1,116 |
40,959,177 | 2016-12-04T13:34:00.000 | 0 | 0 | 0 | 0 | python,tensorflow,deep-learning | 40,960,903 | 1 | true | 0 | 0 | Embedding matrix is similar to any other variable. If you set the trainable flag to True it will train it (see tf.Variable) | 1 | 0 | 1 | In tensorflow,we may see these codes.
embeddings=tf.Variable(tf.random_uniform([vocabulary_size,embedding_size],-1.0,1.0))
embed=tf.nn.embedding_lookup(embeddings,train_inputs)
When tensorflow is training,does embedding matrix remain unchanged?
In a blog,it is said that embedding matrix can update.I wonder how does it ... | In tensorflow,does embedding matrix remain unchanged? | 1.2 | 0 | 0 | 94 |
40,959,626 | 2016-12-04T14:28:00.000 | 0 | 0 | 0 | 0 | python,pandas | 40,962,551 | 2 | false | 0 | 0 | If your index is unique and you are OK with returning one row (in the case of multiple rows having the same max value) then you can use the idxmax method.
df.loc[df['money'].idxmax()]
And if you want to add some flare you can highlight the max value in each column with:
df.loc[df['money'].idxmax()].style.highlight_max(... | 1 | 1 | 1 | searched for this, but cannot find an answer.
Say I have a dataframe (apologies for formatting):
a Dave $400
a Dave $400
a Dave $400
b Fred $220
c James $150
c James $150
d Harry $50
And I want to filter the dataframe so it only shows the rows where the third column is the MAXIMUM value, cou... | Python Pandas - Only showing rows in DF for the MAX values of a column | 0 | 0 | 0 | 327 |
40,960,079 | 2016-12-04T15:15:00.000 | 1 | 0 | 1 | 0 | python,c++,c,algorithm | 40,960,224 | 1 | false | 0 | 0 | The bisection algorithm can be used to find a root in a range where the function is monotonic. You can find such segments by studying the derivative function, but in the general case, no assumptions can be made as to the monotonicity of a given function over any range.
For example, the function f(x) = sin(1/x) has an i... | 1 | 0 | 0 | Is there a way to find all the roots of a function using something on the lines of the bisection algorithm?
I thought of checking on both sides of the midpoint in a certain range but it still doesn't seem to guarantee how deep I would have to go to be able to know if there is a root in the newly generated range; also h... | Bisection algorithm to find multiple roots | 0.197375 | 0 | 0 | 1,208 |
40,960,357 | 2016-12-04T15:42:00.000 | -1 | 0 | 0 | 0 | python,tree,regression,cart | 41,774,573 | 2 | false | 0 | 0 | You can't; use matlab. Struggling with this at the moment. Using a python based home-cooked decision tree is also an option. However, there is no guarantee it will work properly (lots of places you can screw up). And you need to implement with numpy if you want any kind of reasonable run-time (also struggling with t... | 1 | 0 | 1 | I'm using scikit-learn to construct regression trees, using tree.DecisionTreeRegression().
I'm giving 56 data samples and it constructs me a Tree with 56 nodes (pruning=0).
How can I implement some pruning to the tree? Any help is appreciated! | Python Decision Tree Regressor Pruning | -0.099668 | 0 | 0 | 1,207 |
40,963,218 | 2016-12-04T20:21:00.000 | 2 | 1 | 0 | 0 | python,raspberry-pi,raspbian | 40,967,869 | 1 | false | 0 | 0 | Did you try using @restart "your command" in your crontab?
Try crontab -e, and see add @restart python -m SimpleHTTPServer | 1 | 2 | 0 | How would you start SimpleHTTPServer when the Pi boots up?
I made a startup.sh with python -m SimpleHTTPServer & but no luck | Run Python SimpleHTTPServer when raspberry Pi turns on | 0.379949 | 0 | 0 | 231 |
40,963,775 | 2016-12-04T21:19:00.000 | 0 | 0 | 1 | 0 | python,pip | 40,963,832 | 3 | false | 1 | 0 | I've done this before. I created a virtualenv for my project so all dependencies (including the python executable) are contained within the project sub-directory tree. Then just zip up that directory tree. To install elsewhere, just unzip and run it. | 1 | 1 | 0 | For a project, I can't let users use pip install before running the app.
My project is a python flask app that I used pip to grab the dependencies. How do I bundle it so the apps can run without using pip install? | How to bundle python pip dependencies with project so don't need to run pip install | 0 | 0 | 0 | 2,017 |
40,964,465 | 2016-12-04T22:28:00.000 | 0 | 0 | 0 | 0 | python,authentication | 40,964,673 | 1 | false | 0 | 0 | If you do not want to use SSL - there are a few options:
Client must send some authentication token (you may call it password) to server as a one of the first bunch of data sent through the socket. This is the simplest way. Also this way is cross-platform.
Client must send id of his process (OS-specific). Then server ... | 1 | 0 | 0 | Imagine you have two python processes, one server and one client, that interact with each other.
Both processes/programs run on the same host and communicate via TCP, eg. by using the AMP protocol of the twisted framework.
Could you think of an efficient and smart way how both python programs can authenticate each othe... | Mutual authentication of python processes | 0 | 0 | 1 | 79 |
40,968,598 | 2016-12-05T06:51:00.000 | 2 | 0 | 0 | 1 | python,c++,sockets,unix-socket | 40,968,779 | 2 | false | 0 | 0 | It sounds like a design flaw that you need to send this much data over the socket to begin-with and that there is this risk of the reader not keeping up with the writer. As an alternative, you may want to consider using a delta-encoding, where you alternate between "key frame"s (whole frames) and multiple frames encode... | 1 | 0 | 0 | I have a C++ program which reads frames from a high speed camera and write each frame to a socket (unix socket). Each write is of 4096 bytes. Each frame is roughly 5MB. ( There is no guarantee that frame size would be constant but it is always a multiple of 4096 bytes. )
There is a python script which reads from the so... | Yet another confustion about sending/recieving large amount of data over (unix-) socket | 0.197375 | 0 | 0 | 502 |
40,969,733 | 2016-12-05T08:09:00.000 | 4 | 0 | 1 | 1 | python,variables,memory,ipc,ram | 40,969,773 | 4 | false | 0 | 0 | Make it a (web) microservice: formalize all different CLI arguments as HTTP endpoints and send requests to it from main application. | 1 | 1 | 0 | I have a python script, that needs to load a large file from disk to a variable. This takes a while. The script will be called many times from another application (still unknown), with different options and the stdout will be used. Is there any possibility to avoid reading the large file for each single call of the scr... | Keeping Python Variables between Script Calls | 0.197375 | 0 | 0 | 2,241 |
40,971,318 | 2016-12-05T09:46:00.000 | 1 | 1 | 1 | 0 | python,python-unittest,allure | 41,627,450 | 2 | false | 0 | 0 | Allure just add addtitional categories like steps for tests and features/stories for group of test. Test fixture is responsibility of testing framework not reporting like Allure. | 2 | 1 | 0 | Does allure plugin for python have setup/teardown facilities, like those of python unittest module? | Does allure plugin for python have setup/teardown facilities? | 0.099668 | 0 | 0 | 539 |
40,971,318 | 2016-12-05T09:46:00.000 | 1 | 1 | 1 | 0 | python,python-unittest,allure | 45,822,745 | 2 | false | 0 | 0 | There are no such facilities like setUp or tearDown in allure.
But you can use the py.test fixtures to implement setUp and tearDown by yourself. | 2 | 1 | 0 | Does allure plugin for python have setup/teardown facilities, like those of python unittest module? | Does allure plugin for python have setup/teardown facilities? | 0.099668 | 0 | 0 | 539 |
40,972,550 | 2016-12-05T10:52:00.000 | 0 | 0 | 0 | 0 | python-3.x,flask,compiler-errors | 40,977,871 | 1 | true | 1 | 0 | I got this sorted out . Perhaps because I had set raise_exceptions=True, Setting it to False resolved the issue | 1 | 0 | 0 | I am trying to validate username and password of users in a flask app using ldap3. Normal ldap is not installing in python 3.5.
The user is entering username and password through login form, I am trying to authenticate user with username / password and allow them to access the index page if it is authenticated.
Doe... | ldap3 bind syntax error in flask application | 1.2 | 0 | 0 | 1,094 |
40,973,950 | 2016-12-05T12:07:00.000 | 0 | 1 | 0 | 0 | python,rest,gis | 41,084,870 | 2 | false | 1 | 0 | realestate.co.nz seems to have both Javascript and Ruby APIs. I'm going to investigate the possibility of building a Python port as their code is on github/realestate.co.nz
I have no financial interest in either TradeMe or realestate.co.nz, for the record. Just a guy trying to avoid screen scraping. | 2 | 0 | 0 | I failed to get approval for my application that I started to write against the TradeMe API. My API access was not approved. I'm therefore looking for alternatives.
Any NZ property for sale APIs out there? I have seen realestate.co.nz which according to the github repo, might provide something in PHP and Ruby, but t... | NZ Property for sale API | 0 | 0 | 0 | 453 |
40,973,950 | 2016-12-05T12:07:00.000 | 0 | 1 | 0 | 0 | python,rest,gis | 41,067,476 | 2 | false | 1 | 0 | The sandbox should let you access trademe without the need to access the main server. | 2 | 0 | 0 | I failed to get approval for my application that I started to write against the TradeMe API. My API access was not approved. I'm therefore looking for alternatives.
Any NZ property for sale APIs out there? I have seen realestate.co.nz which according to the github repo, might provide something in PHP and Ruby, but t... | NZ Property for sale API | 0 | 0 | 0 | 453 |
40,974,077 | 2016-12-05T12:15:00.000 | 0 | 0 | 0 | 0 | python,modbus,can-bus,canopen | 41,042,839 | 1 | true | 0 | 0 | This will be the gateway's business to fix. There is no general answer, nor is there a standard for how such gateways work. Gateways have some manner of software that allows you to map data between the two field buses. In this case I suppose it would be either a specific CANopen PDO or a specific CAN id that you map to... | 1 | 0 | 0 | I am now studying and developing a CANopen client with a python stack and i'm struggling to find out how to communicate with a slave Modbus through a gateway.
Since the gateway address is the one present in the Object Dictionary of the CANopen, and the Gateway has addresses of modbus Slaves I/O, how to specify the addr... | How does CANopen client communicate with Modbus slave through CANopen/Modbus gateway ? | 1.2 | 0 | 1 | 339 |
40,974,327 | 2016-12-05T12:29:00.000 | 4 | 0 | 1 | 0 | python,pycharm,project | 40,974,533 | 1 | true | 0 | 0 | In Pycharm Preferences, Appearance & Behaviour > System Settings, and there will be a Startup/Shutdown section. It doesn't look like you can specify a particular project, but you can stop it from reopening the last project on startup (which is what seems to be happening for you now), and select from a list instead. | 1 | 0 | 0 | Every time I start PyCharm Community Edition it automatically opens a project in the PyCharmProjects directory. There are several projects in that directory. I would like to have another project open automatically. Is that possible? | How can I change the default project in PyCharm? | 1.2 | 0 | 0 | 2,361 |
40,976,901 | 2016-12-05T14:46:00.000 | 0 | 0 | 1 | 0 | python,json,csv | 40,977,897 | 1 | false | 0 | 0 | turns out it was the json.dumps(), should've read more into what it does! Thanks. | 1 | 0 | 1 | I've been researching the past few days on how to achieve this, to no avail.
I have a JSON file with a large array of json objects like so:
[{
"tweet": "@SHendersonFreep @realDonaldTrump watch your portfolios go to the Caribbean banks and on to Switzerland. Speculation without regulation",
"user": "DGregsonRN"
... | Access key value from JSON array of objects Python | 0 | 0 | 0 | 1,675 |
40,978,516 | 2016-12-05T16:11:00.000 | 1 | 0 | 0 | 0 | python,web-services,rest,dsl,mps | 40,981,915 | 1 | true | 0 | 0 | I think this is a nice idea. To determine what kind of solution you could build you should consider different aspects:
Who would write these API combinations?
What kind of tool support would be appropriate? I mean validation, syntax highlighting, autocompletion, typesystem checks, etc
How much time would make sense to... | 1 | 1 | 0 | We have a back end that exposes 50-60 Rest APIs. These will largely be consumed by standalone applications like a Python script or a Java program.
One issue we have is the APIs are at a very granular level, they do not match the business use case. For example to perform a business use case end user might have to call 4... | Meta language for rest client | 1.2 | 0 | 1 | 190 |
40,980,163 | 2016-12-05T17:42:00.000 | 0 | 0 | 0 | 0 | python-2.7,wxpython,word-wrap | 64,083,696 | 3 | false | 0 | 1 | It would be more maintainable to use the constants stc.WRAP_NONE, stc.WRAP_WORD, stc.WRAP_CHAR and stc.WRAP_WHITESPACE instead of their numerical values. | 2 | 1 | 0 | I was wondering about this, so I did quite a bit of google searches, and came up with the SetWrapMode(self, mode) function. However, it was never really detailed, and there was nothing that really said how to use it. I ended up figuring it out, so I thought I'd post a thread here and answer my own question for anyone e... | How to set up word wrap for an stc.StyledTextCtrl() in wxPython | 0 | 0 | 0 | 265 |
40,980,163 | 2016-12-05T17:42:00.000 | 0 | 0 | 0 | 0 | python-2.7,wxpython,word-wrap | 40,986,021 | 3 | false | 0 | 1 | I see you answered your own question, and you are right in every way except for one small detail. There are actually several different wrap modes. The types and values corresponding to them are as follows:
0: None
1: Word Wrap
2: Character Wrap
3: White Space Wrap
So you cannot enter any value above 0 to get word wra... | 2 | 1 | 0 | I was wondering about this, so I did quite a bit of google searches, and came up with the SetWrapMode(self, mode) function. However, it was never really detailed, and there was nothing that really said how to use it. I ended up figuring it out, so I thought I'd post a thread here and answer my own question for anyone e... | How to set up word wrap for an stc.StyledTextCtrl() in wxPython | 0 | 0 | 0 | 265 |
40,980,731 | 2016-12-05T18:16:00.000 | 0 | 0 | 0 | 0 | python,flask,alembic,flask-migrate | 64,959,830 | 2 | false | 1 | 0 | You can also check in your database and the current version should be displayed in a table called alembic_version. | 2 | 2 | 0 | My flask application now has 20+ migrations built with flask-migrate and they all have hashed file names like: 389d9662fec7_.py
I want to double check the settings on the latest migration that I ran, but don't want to open every file to look for the correct one. I could create a new dummy migration and look at what it ... | How do I find the latest migration created w/ flask-migrate? | 0 | 0 | 0 | 1,521 |
40,980,731 | 2016-12-05T18:16:00.000 | 3 | 0 | 0 | 0 | python,flask,alembic,flask-migrate | 40,980,983 | 2 | true | 1 | 0 | ./manage.py db history -r current: will show the migrations in the order they will be applied. -r current: shows only the migrations since the currently applied one.
./manage.py db heads will show the most recent migration for each branch (typically there's only one branch). ./manage.py db upgrade would apply all migra... | 2 | 2 | 0 | My flask application now has 20+ migrations built with flask-migrate and they all have hashed file names like: 389d9662fec7_.py
I want to double check the settings on the latest migration that I ran, but don't want to open every file to look for the correct one. I could create a new dummy migration and look at what it ... | How do I find the latest migration created w/ flask-migrate? | 1.2 | 0 | 0 | 1,521 |
40,981,908 | 2016-12-05T19:33:00.000 | 3 | 1 | 0 | 0 | python,amazon-web-services,aws-lambda | 40,981,986 | 3 | false | 0 | 0 | AWS Lambda's Python environment comes pre-installed with boto3. Any other libraries you want need to be part of the zip you upload. You can install them locally with pip install whatever -t mysrcfolder. | 1 | 1 | 0 | I'm new to AWS Lambda and pretty new to Python.
I wanted to write a python lambda that uses the AWS API.
boto is the most popular python module to do this so I wanted to include it.
Looking at examples online I put import boto3 at the top of my Lambda and it just worked- I was able to use boto in my Lambda.
How does A... | How does AWS know where my imports are? | 0.197375 | 0 | 1 | 70 |
40,987,039 | 2016-12-06T02:51:00.000 | 4 | 0 | 0 | 0 | python,django,sqlite | 40,987,703 | 1 | false | 1 | 0 | Delete all the folders named 'migrations'. And go to terminal and run ./manage.py makemigrations, ./manage.py migrate --run-syncdb. | 1 | 2 | 0 | I deleted my database. I want to start afresh with a new database. How can I do that ? I tried making a new datasource but it gives me an error while applying migrations/or migrating that it couldn't find the tables? Which is true because its an empty database.
A similar scenario would be when some one pulls a version... | How to start afresh with a new database in Django? | 0.664037 | 0 | 0 | 3,214 |
40,987,412 | 2016-12-06T03:38:00.000 | 1 | 0 | 0 | 0 | python,sockets,connect,wireless | 40,987,772 | 2 | false | 0 | 0 | but one question. Is the socket server specific to python, or can
another language host and python connect or vise-versa?
As long as you are using sockets - you can connect to any socket-based server (made with any language). And vice-versa: any socket-based client will be able to connect to your server. Moreover it... | 1 | 1 | 0 | I am wondering if there is any way to wirelessly connect to a computer/server using python's socket library. The dir(socket) brought up a lot of stuff and I wanted help sorting it out. | How do I wirelessly connect to a computer using python | 0.099668 | 0 | 1 | 102 |
40,989,746 | 2016-12-06T07:12:00.000 | 1 | 0 | 1 | 0 | python,exe,command-prompt,python-3.5,pyinstaller | 40,989,945 | 2 | false | 0 | 0 | You don't have module named pefile install the module pip install pefile then try again | 1 | 0 | 0 | How to convert python Python1.py created in Visual Studio 2015 to Python1.exe, with PyInstaller I gut error, so need to find some other tool to convert my PythonConsole.py to PythonConsole.exe | Convert .py to .exe | 0.099668 | 0 | 0 | 369 |
40,989,958 | 2016-12-06T07:26:00.000 | 0 | 1 | 0 | 1 | python,ibm-cloud,nao-robot | 41,919,816 | 1 | false | 0 | 0 | You can add any path to the PYTHONPATH environment variable from within your behavior. However, this has bad side effects, like:
If you forget to remove the path from the environment right after importing your module, you won't know anymore where you are importing modules from, since there is only one Python context f... | 1 | 0 | 0 | Currently, I am doing a project about Nao Robot. I am having problem with importing the python class file into choregraphe. So anyone knows how to do this?
Error message
[ERROR] behavior.box :init:8 _Behavior__lastUploadedChoregrapheBehaviorbehavior_1271833616__root__RecordSound_3__RecSoundFile_4: ALProxy::ALProx... | How to import IBM Bluemix Watson speech-to-text in Choregraphe? | 0 | 0 | 0 | 272 |
40,991,259 | 2016-12-06T08:52:00.000 | 2 | 0 | 1 | 1 | python,pyinstaller | 56,047,956 | 2 | false | 0 | 0 | If you set your command directory to the .py script location and run pyinstaller yourscript.py, it will generate folders in the same location as your script. The folder named dist/ will contain the .exe file. | 1 | 2 | 0 | I am completely new to python and trying to create an application (or .exe) file for python using pyinstaller. I ran the command pyinstaller -[DIRECTORY].py and it saved it to an output directory "C:\Windows\System32\Dist\Foo", however when i tried to locate the directory it did not seem to exist (Dist).
NOTE: i'm try... | Cannot find output folder for .exe file using pyinstaller | 0.197375 | 0 | 0 | 2,898 |
40,991,949 | 2016-12-06T09:31:00.000 | 2 | 0 | 0 | 0 | python,gtk,gtk3,pygobject | 41,002,629 | 1 | false | 0 | 1 | Setting the window size request should be sufficient. If your UI makes the window larger that is the same as your widgets becoming truncated on a smaller monitor.
To prevent this you'll need to put widgets that grows your UI inside scrollable windows. Watch out for labels. You will need to get them to wrap properly. | 1 | 2 | 0 | I want to test the appearance of a window on a smaller monitor than the one I'm using on the development machine.
I tried with set_geometry_hints() (setting minimum and maximum width and height), set_resizable(False), set_default_size(), and set_size_request(). However every time the window is bigger, because child wi... | Gtk3: set a fixed window size (smaller than the requested size from the child widgets) | 0.379949 | 0 | 0 | 1,748 |
40,992,566 | 2016-12-06T10:02:00.000 | 0 | 0 | 1 | 0 | python,python-2.7,pycharm | 45,028,022 | 1 | false | 0 | 0 | I know of 2 quick ways, but none of them is quick enough.
1: Using the AceJump addon, you just jump to one parens, hit delete, then jump to the other one, and hit delete... Naturally this has the disadvantage that parentheses in a situation like this: ([{(([]))}) would be harder to jump to.
2: There is a command called... | 1 | 7 | 0 | The opening and closing quotes (or brackets, braces etc) are highlighted in PyCharm(and other editors). So this means it can identify the pair.
Now, is there a way to delete both the quotes at once (or brackets, braces etc) when either of the opening or closing quotes are deleted, Since it identifies the pair?
For eg.... | Delete opening and closing quotes (or brackets,braces,etc) at once | 0 | 0 | 0 | 574 |
40,993,351 | 2016-12-06T10:41:00.000 | 1 | 0 | 0 | 0 | python,python-2.7,python-3.x | 40,993,473 | 2 | false | 0 | 0 | If you did not kill the Python process, then it is most likely that the system ran out of some resource, and then the OS will kill it. | 2 | 0 | 0 | When I run Python script after I get message Killed. What does it mean?
I tried to find logs, but they are empty | Why I get message Killed in Python? | 0.099668 | 0 | 0 | 99 |
40,993,351 | 2016-12-06T10:41:00.000 | 2 | 0 | 0 | 0 | python,python-2.7,python-3.x | 40,993,472 | 2 | true | 0 | 0 | What does it mean?
answer -
Your script crossed some limit in the amount of system resources that you are allowed to use. Depending on your OS and configuration, this could mean you had too many open files, used too much filesytem space or something else. | 2 | 0 | 0 | When I run Python script after I get message Killed. What does it mean?
I tried to find logs, but they are empty | Why I get message Killed in Python? | 1.2 | 0 | 0 | 99 |
40,995,291 | 2016-12-06T12:20:00.000 | 0 | 0 | 1 | 0 | python,numpy,hdf5 | 40,995,578 | 1 | false | 0 | 0 | accepted
locals().update(npzfile)
a # and/or b
In the Ipython session, locals() is a large dictionary with variables the you've defined, the input history lines, and various outputs. Update adds the dictionary values of npzfile to that larger one.
By the way, you can also load and save MATLAB .mat files. Use scipy.io... | 1 | 0 | 1 | I have a large data-set that I want save them in a npz file. But because the size of file is big for memory I cant save them in npz file.
Now i want insert data in iterations into npz file.
How can I do this?
Are HDF5 is better for this? | How can I update npz file in python? | 0 | 0 | 0 | 528 |
40,997,813 | 2016-12-06T14:33:00.000 | 1 | 0 | 0 | 0 | python,dymola | 41,197,119 | 1 | false | 0 | 0 | You can reduce the size of the simulation result file by using variable selections in Dymola. That will restrict the output to states, parameters, and the variables that match your selection criteria.
The new Dymola 2017 FD01 has a user interface for defining variable selections. | 1 | 1 | 1 | I have been having some issues trying to open a simulation result output file (.mat) in Python. Upon loading the file I am faced with the following error:
ValueError: Not enough bytes to read matrix 'description'; is this a
badly-formed file? Consider listing matrices with whosmat and
loading named matrices with v... | Not enough memory to read .mat result file into Python | 0.197375 | 0 | 0 | 374 |
41,000,124 | 2016-12-06T16:23:00.000 | 0 | 0 | 1 | 0 | python,matplotlib,spyder | 63,757,231 | 1 | false | 0 | 0 | did you try this:
plot window pane -> Mute inline plotting
Toggle to enable / disable plotting within spyder plot window pane | 1 | 0 | 0 | I am used to code in Vim and run my scripts on the command line. My coworker uses Spyder, with is, I admit, a very good tool.
The problem comes in scripts that use matplotlib, where Spyder (or IPython) interferes with at least pyplot.show(), which is typically not required in Spyder, and pyplot.savefig(), which causes ... | How to have Spyder act as command line Python interpreter | 0 | 0 | 0 | 552 |
41,001,442 | 2016-12-06T17:34:00.000 | 1 | 0 | 1 | 0 | python | 41,001,555 | 4 | false | 0 | 0 | Only slightly less new than you but I'll give this one a go, basically opening and closing are pretty different actions in a language like python. When you are opening the file what you are really doing is creating an object to be worked within your application that represents the file, so you create it with a functio... | 1 | 8 | 0 | Regarding syntax in Python
Why do we use open("file") to open but not "file".close() to close it?
Why isn't it "file".open() or inversely close("file")? | Python open() vs. .close() | 0.049958 | 0 | 0 | 3,290 |
41,001,551 | 2016-12-06T17:40:00.000 | 3 | 0 | 0 | 0 | python,django,bash,python-venv | 41,004,545 | 2 | true | 1 | 0 | run virtualenv venv in you desired directory
after install from t run :
source \your_folder\venv\bin\activate
now you sohuld see (venv) before $ in the shell
that mean you env is active
install packages run pip install package_name
run pip freeze to get installed packages
go to project folder that include manage.py ... | 1 | 0 | 0 | I have been given an existing project to work on and I am really struggling to get the environment set up.
The project folder firstly contains manage.py server, which I use as an entry point to run the server.
There is also a venv folder which contains all the modules etc. I need.
So when I do runserver on manage.py... | How to run manage.py inside venv? | 1.2 | 0 | 0 | 4,324 |
41,003,897 | 2016-12-06T20:05:00.000 | 1 | 0 | 0 | 0 | python,scikit-learn,cross-validation | 41,003,996 | 1 | false | 0 | 0 | If you run cross_val_predict then you can check the metric on the result. It is not a waste of compute time because cross_val_predict doesn't compute scores itself.
This won't give you per-fold scores though, only the aggregated score (which is not necessarily bad). I think you can workaround that by creating KFold / ... | 1 | 1 | 1 | I'm not sure whether I'm missing something really easy but I have a hard time trying to google something out.
I can see there are cross_val_score and cross_val_predict functions in scikit-learn. However, I can't find a way to get both score and predictions at one go. Seems quite obvious as calling the functions above o... | Scikit-learn - Cross validates score and predictions at one go? | 0.197375 | 0 | 0 | 80 |
41,005,047 | 2016-12-06T21:15:00.000 | 6 | 0 | 1 | 0 | python,pycharm | 41,005,483 | 2 | false | 0 | 0 | Select the file in the Project or Project Files pane and then hit File>Save as... The save-as dialog that pops up has an option (checked by default) to "open copy in editor". Not exactly what you asked for but it's the easiest way I could find. | 2 | 9 | 0 | Just got started with pycharm and was wondering how can I simply copy a file in pycharm for editing purposes? For instance, I have a file opened, want to edit the code but want to make sure that I do not accidentally "over-save" the original file.
In other environments, I can simply right click the file, and copy it t... | Pycharm - how can I copy a file (tab) in pycharm (to a new tab)? | 1 | 0 | 0 | 2,801 |
41,005,047 | 2016-12-06T21:15:00.000 | 7 | 0 | 1 | 0 | python,pycharm | 41,005,579 | 2 | true | 0 | 0 | If I understood well, you are looking for to a something similar duplicate functionality.
So to do this, you can simply go to the project structure (the panel to the left) and copy the file in this way:
simply Ctrl + c
Right click on choosen file > Copy
After this, paste your file in the directory that you want in th... | 2 | 9 | 0 | Just got started with pycharm and was wondering how can I simply copy a file in pycharm for editing purposes? For instance, I have a file opened, want to edit the code but want to make sure that I do not accidentally "over-save" the original file.
In other environments, I can simply right click the file, and copy it t... | Pycharm - how can I copy a file (tab) in pycharm (to a new tab)? | 1.2 | 0 | 0 | 2,801 |
41,006,591 | 2016-12-06T23:06:00.000 | 1 | 0 | 0 | 0 | python,django,django-models,solr,django-haystack | 41,016,811 | 1 | true | 1 | 0 | There is no need to keep updating a expires_in field in your database - keep an expires_at with the time when the ad expires, and calculate the time left in your retrieval method in your model or in your view.
This way you'll avoid having to write more data to your database as traffic increases, and if the expiry date... | 1 | 0 | 0 | I use Django as backend for my web-app and django-haystack(with Solr) for searching & displaying results.
I use the RealTimeSignalProccessor form django-haystack , but I have one problem:
- I have an Auction model and expires-(DateTimeField). When I'm displaying the results I'm doing it similar like e-bay (ex. Expires... | Optimize displaying results with django-haystack RealTimeSignalProcessor | 1.2 | 0 | 0 | 78 |
41,010,560 | 2016-12-07T06:09:00.000 | 2 | 0 | 0 | 1 | python,apache-spark,celery,distributed,jobs | 41,021,060 | 2 | false | 1 | 0 | Adding to the above answer, there are other areas also to identify.
Integration with the existing big data stack if you have.
Data pipeline for ingestion
You mentioned "backend for web application". I assume its for read operation. The response times for any batch application might not be a good fit for any web applic... | 2 | 2 | 1 | Problem: calculation task can be paralleled easily. but it is needed real-time response.
There can be two approaches.
1. using Celery: runs job in parallel from scratch
2. using Spark: runs job in parallel with spark framework
I think spark is better in scalability perspective. But is it OK Spark as backend of web-appl... | For distributing calculation task, which is better celery or spark | 0.197375 | 0 | 0 | 3,004 |
41,010,560 | 2016-12-07T06:09:00.000 | 1 | 0 | 0 | 1 | python,apache-spark,celery,distributed,jobs | 41,012,633 | 2 | true | 1 | 0 | Celery :- is really a good technology for distributed streaming And its supports Python language . Which is it self strong in computation and easy to write. The streaming application in Celery supports so many features as well . Its little over head on CPU.
Spark- Its supports various programming language Java,Scala,Py... | 2 | 2 | 1 | Problem: calculation task can be paralleled easily. but it is needed real-time response.
There can be two approaches.
1. using Celery: runs job in parallel from scratch
2. using Spark: runs job in parallel with spark framework
I think spark is better in scalability perspective. But is it OK Spark as backend of web-appl... | For distributing calculation task, which is better celery or spark | 1.2 | 0 | 0 | 3,004 |
41,017,578 | 2016-12-07T12:32:00.000 | 0 | 0 | 1 | 0 | python,python-3.x | 41,017,686 | 1 | false | 0 | 0 | Just use {} and [] and forget about dict() and list() | 1 | 0 | 0 | I've heard that construction {} works much faster then dict(). But does that mean I have to write {} everywhere ? | Is there any reason in writing dict() instead of {}? | 0 | 0 | 0 | 89 |
41,020,061 | 2016-12-07T14:30:00.000 | 6 | 0 | 1 | 0 | python | 41,020,095 | 2 | true | 0 | 0 | No, they are not.
But slicing [0:1] will always give you a subset of the iterable. If you want to just get the element, just do so: t[0]. That is an integer, not a tuple. | 1 | 3 | 0 | I'm slightly confused over tuple notation. Is each of the elements in a tuple treated as a tuple or as whatever type that element is?
For example, for the tuple t = (1,2,3,4), 1 in t is True, which means that the int 1 is in the tuple t.
However, if I evaluate t[0:1], we get the tuple (1,).
Even more confusing is the f... | Are the elements of tuples, themselves tuples? | 1.2 | 0 | 0 | 51 |
41,020,807 | 2016-12-07T15:03:00.000 | 0 | 1 | 0 | 0 | python,django,django-templates,django-views | 41,021,233 | 2 | false | 1 | 0 | In your views you can handle any incoming get/post requests. And based on handler for that button (and this button obviously must send something to server) you can call any function. | 1 | 0 | 0 | Let's say that I have a python function that only sends email to myself, that I want to call whenever the user clicks on a button in a template, without any redirection (maybe just a popup messege).
Is there a way to do that? | Django: call python function when clicking on button | 0 | 0 | 0 | 981 |
41,021,109 | 2016-12-07T15:17:00.000 | 3 | 1 | 0 | 1 | python,user-interface,terminal,raspberry-pi | 41,022,529 | 2 | false | 0 | 0 | Without knowing you Pi setup it's a bit difficult. But with the assumption you're running raspbian with its default "desktop" mode:
Open a terminal on your Pi, either by sshing to it or connecting a monitor/keyboard.
First we need to allow you to login automatically, so sudo nano /etc/inittab to open the inittab for ... | 1 | 2 | 0 | I want to run a python script which executes a GUI on startup(as pi boots up). But I don't see any GUI on screen but when I open terminal my program executes automatically and GUI appears. Also, my program requires an internet connection on execution but pi connects to wifi later and my script executes first and ends ... | raspberry pi : Auto run GUI on boot | 0.291313 | 0 | 0 | 7,947 |
41,022,923 | 2016-12-07T16:45:00.000 | 2 | 1 | 0 | 0 | python,pic,pyserial,ftdi | 41,058,265 | 1 | false | 1 | 0 | So I found that the rounded numbers didn't work i.e. 100000, 200000, 250000 but the multiples of 115200 do. i.e. 230400, 460800
I tried to use 230400 at first but the baud rate my microcontroller can produce is either 235294 or 222222. 235294 yields an error of -2.1% and 222222 yields an error of 3.55%. I naturally pic... | 1 | 3 | 0 | I'm trying to get pySerial to communicate with a microcontroller over an FTDI lead at a baud rate of 500,000. I know my microcontroller and FTDI lead can both handle it as can my laptop itself, as I can send to a putty terminal at that baud no problem. However I don't get anything when I try to send stuff to my python ... | PySerial - Max baud rate for platform (windows) | 0.379949 | 0 | 0 | 3,411 |
41,023,513 | 2016-12-07T17:16:00.000 | 0 | 0 | 1 | 0 | python,pycharm,remote-debugging | 53,441,266 | 6 | false | 0 | 0 | Turning off the firewall addressed the problem in my case (macOS - Mojave). Note that this is not a general solution as it was not tested in any other environments/OS. | 3 | 22 | 0 | When I start PyCharm for remote python interpreter, it always performs "Uploading PyCharm helpers", even when the remote machine IP is the same and already containing previously uploaded helpers. Is the behaviour correct? | pycharm always "uploading pycharm helpers" to same remote python interpreter when starts | 0 | 0 | 0 | 10,073 |
41,023,513 | 2016-12-07T17:16:00.000 | 1 | 0 | 1 | 0 | python,pycharm,remote-debugging | 54,241,936 | 6 | false | 0 | 0 | Note that -- at least as late as version 2018.3.x -- PyCharm also appears to require re-uploading of the helpers when the local network connection changes as well, for some reason.
What I've observed in my case is that if, while PyCharm remains running, I relocate my laptop and connect to a different LAN, the next remo... | 3 | 22 | 0 | When I start PyCharm for remote python interpreter, it always performs "Uploading PyCharm helpers", even when the remote machine IP is the same and already containing previously uploaded helpers. Is the behaviour correct? | pycharm always "uploading pycharm helpers" to same remote python interpreter when starts | 0.033321 | 0 | 0 | 10,073 |
41,023,513 | 2016-12-07T17:16:00.000 | 2 | 0 | 1 | 0 | python,pycharm,remote-debugging | 70,324,377 | 6 | false | 0 | 0 | In my case, several projects are projected to the remote server by Pycharm. All of them get stuck when one of the projects goes wrong on the remote server. Solution: leave only one that you need to work on and restart the PyCharm by "Invalidate caches". | 3 | 22 | 0 | When I start PyCharm for remote python interpreter, it always performs "Uploading PyCharm helpers", even when the remote machine IP is the same and already containing previously uploaded helpers. Is the behaviour correct? | pycharm always "uploading pycharm helpers" to same remote python interpreter when starts | 0.066568 | 0 | 0 | 10,073 |
41,024,605 | 2016-12-07T18:21:00.000 | 3 | 1 | 1 | 0 | python | 41,024,664 | 1 | true | 0 | 0 | In most test runners, a test failure is indicated by raising an exception - which is what the assert() function does if its argument evaluates to False.
Thus assert(1 == 0) will fail, and abort that specific test with an AssertionError exception. This is caught by the test framework, and the test is marked as having fa... | 1 | 0 | 0 | I have gone through many source code of functional test cases written in python. Many of the code uses assert for testing equality, why so? | Use of assert statement in test cases written in python | 1.2 | 0 | 0 | 224 |
41,025,035 | 2016-12-07T18:46:00.000 | 0 | 0 | 1 | 0 | python,goto | 41,025,132 | 3 | false | 0 | 0 | There is no goto built into Python. There are ways to effectively 'halt' in a method by using yield and creating a generator, which is effectively how Python coroutines work (see the asyncio module) however this isn't really appropriate for your needs.
For saving game state, saving and serialising the state you need to... | 1 | 0 | 0 | I'm coding a text game in python 3.4 and when I though about making a save game came the question:
How can I jump to the place that the player stopped?
I'm making a simple game, me and my friends, so I just wanna jump to a certain part of the code, and I can't do that without having to make around 15 copies of the code... | Goto\Jump in Python | 0 | 0 | 0 | 2,080 |
41,030,128 | 2016-12-08T01:10:00.000 | 0 | 0 | 1 | 0 | string,python-3.x,character-encoding | 42,528,593 | 3 | false | 0 | 0 | i am far from a python expert but : str('yadayada').encode('utf-8).decode('utf-8)
contains syntax errors,
str('yadayada').encode('utf-8').decode('utf-8') ==mind the closing ' <== works fine | 1 | 11 | 0 | I have some code that grabs strings from one environment and reproduces them in another. I am using Python 3.5. I keep running into this kind of error:
UnicodeEncodeError: 'latin-1' codec can't encode character '\u2013' in
position 112: Body ('–') is not valid Latin-1. Use
body.encode('utf-8') if you want to sen... | str encoding from latin-1 to utf-8 arbitrarily | 0 | 0 | 0 | 21,059 |
41,031,326 | 2016-12-08T03:33:00.000 | 0 | 0 | 1 | 0 | python,database,file,cloud,storage | 41,031,479 | 1 | false | 0 | 0 | You could install gsutil and the boto library and use that. | 1 | 0 | 0 | I currently have a Python program which reads a local file (containing a pickled database object) and saves to that file when it's done. I'd like to branch out and use this program on multiple computers accessing the same database, but I don't want to worry about synchronizing the local database files with each other, ... | Access a Cloud-stored File using Python 3? | 0 | 1 | 0 | 57 |
41,038,457 | 2016-12-08T11:32:00.000 | 0 | 1 | 0 | 0 | python,midi,music21 | 41,043,154 | 3 | false | 0 | 0 | The SMF format has no restrictions on how events are organized into tracks. It is common to have one track per channel, but it's also possible to have multiple channels in one track, or multiple tracks with events for the same channel.
The organization of the tracks is entirely determined by humans. It is unlikely that... | 1 | 3 | 0 | I'm processing a bulk of midi files that are made for existing pop songs using music21.
While channel 10 is reserved for percussions, melodic tracks are all over different channels, so I was wondering if there is an efficient way to pick out the main melody (vocal) track.
I'm guessing one way to do it is to pick a trac... | music21: picking out melody track | 0 | 0 | 0 | 1,661 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.