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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
31,330,946 | 2015-07-10T01:18:00.000 | 1 | 0 | 1 | 0 | python,notepad++ | 31,330,984 | 3 | false | 0 | 0 | What I have been doing is this:
Press F5 to run.
Paste this | C:\Python27\python.exe "$(FULL_CURRENT_PATH)"
Replace Python27 with whatever version you use.
Then run.
It should take what you're writing and run it, make sure to select Python as the current language too.
Sorry if this isn't what you're looking for, I'm j... | 3 | 0 | 0 | I'm having trouble executing my programs in Notepad++. I'm currently operating on Windows 7.
When attempting to run the program in the the interpreter, I have to jump through numerous hoops to actually get my program to execute. In Notepad++, I'm unable to provide additional text if I'd like to run a sys.argv command, ... | Problems running Python in Notepad++ | 0.066568 | 0 | 0 | 1,372 |
31,330,946 | 2015-07-10T01:18:00.000 | 4 | 0 | 1 | 0 | python,notepad++ | 31,331,079 | 3 | false | 0 | 0 | Run your code from command interpreter.It will look like this
C:\Python27\python.exe programe_name.py
change directory where your program is save before the command.I recommend you to download IDLE editor.It is easy way to learn python. | 3 | 0 | 0 | I'm having trouble executing my programs in Notepad++. I'm currently operating on Windows 7.
When attempting to run the program in the the interpreter, I have to jump through numerous hoops to actually get my program to execute. In Notepad++, I'm unable to provide additional text if I'd like to run a sys.argv command, ... | Problems running Python in Notepad++ | 0.26052 | 0 | 0 | 1,372 |
31,330,946 | 2015-07-10T01:18:00.000 | 0 | 0 | 1 | 0 | python,notepad++ | 31,331,737 | 3 | true | 0 | 0 | There are better editors which can run python without a problem. Github's atom can do this easily and is a great free solution and Sublime Text 2 is also both free and paid.
However, if you absolutely have to run on NotePad++, do click Run on the Menu and then Run again. Now, type in the shell command you would like t... | 3 | 0 | 0 | I'm having trouble executing my programs in Notepad++. I'm currently operating on Windows 7.
When attempting to run the program in the the interpreter, I have to jump through numerous hoops to actually get my program to execute. In Notepad++, I'm unable to provide additional text if I'd like to run a sys.argv command, ... | Problems running Python in Notepad++ | 1.2 | 0 | 0 | 1,372 |
31,331,862 | 2015-07-10T03:15:00.000 | 1 | 0 | 1 | 0 | python,python-2.7,python-3.x,python-internals | 31,334,203 | 2 | true | 0 | 0 | Python has two basic modes: normal and interactive. The normal mode is the mode where the scripted and finished .py files are run in the Python interpreter. Interactive mode is a command line shell which gives immediate feedback for each statement, while running previously fed statements in active memory. As new lines ... | 1 | 3 | 0 | I want to know how Python interactive mode works. Usually when you run Python script on CPython it will go trough the process of lexical analysis, parsing, gets compiled into .pyc file, and finally the .pyc file is interpreted.
Does this 4-step process happen while using interactive mode also, r is there a more effici... | How does Python's interactive mode work? | 1.2 | 0 | 0 | 1,991 |
31,333,537 | 2015-07-10T06:03:00.000 | 0 | 0 | 1 | 0 | python,dictionary | 31,334,518 | 2 | false | 0 | 0 | To be honest it actually works like associative map in C++..If you have ever used C++ then..If you see the source code of Python Interpreter, you will see that it uses your heap memory section to store data to two type & use pointers to point one data to other exactly like map works in C++. In my system it is 280.. Now... | 1 | 3 | 0 | If we create an empty dictionary, like: idict = {}, how many spaces are assigned for this dictionary ? I know for the list, if we initialize a list like ilist = [], it will always over-allocate the size, first is 4 space, then 8.
What about a dictionary ? | how many space assigned for empty dictionary in python? | 0 | 0 | 0 | 474 |
31,339,599 | 2015-07-10T11:25:00.000 | 1 | 0 | 1 | 0 | python,python-2.7,python-magic,libmagic | 63,376,470 | 3 | false | 0 | 0 | I solve this issue installing the library "python-magic-bin" using the command pip install python-magic-bin | 1 | 2 | 0 | Hi I'm trying to use python-magic on windows 8 but when I try to import with the command import magic it gives me this error WindowsError: [Error 193] %1 is not a valid Win32 application I have tried both with 64-bit and 32-bit version of Python 2.7.10 but I always get this error.
Thx | python-magic WindowsError: [Error 193] %1 is not a valid Win32 application | 0.066568 | 0 | 0 | 1,764 |
31,340,239 | 2015-07-10T12:00:00.000 | 2 | 0 | 1 | 0 | python | 31,340,275 | 2 | false | 0 | 0 | No, you shouldn't. Python has other forms of error handling, and if you really want to return a success code true and false is the better way. As a caller you should really be able to assume that everything went as expected, and then you can throw some kind of descriptive error if something went wrong. | 1 | 6 | 0 | In C, if I'm not wrong, the main function returns 0 if no errors occurred, and something different from 0 if an error occurs.
Is is appropriate to do the same in Python (as long as a function does not have to return any specific value but one to indicate the success/failure); or instead just handle exceptions? | Error handling methodology | 0.197375 | 0 | 0 | 833 |
31,341,127 | 2015-07-10T12:44:00.000 | 1 | 0 | 0 | 0 | python,python-2.7,matplotlib,multiprocessing | 38,479,294 | 2 | false | 0 | 0 | I just had a very similar issue in which I have a class which produces plots in parallel. The first time I create a new instance of that class and run the plotting function, everything works perfectly. But if I create a new instance and plot, everything freezes.
I fixed it by writing a bash script which will in turn ru... | 1 | 6 | 1 | I have an issue with matplotlib and multiprocessing.
I launch a first process, where I display an image and select an area, and close the figure. Then I launch another process, where I call a graph function that is regularly updated. Up this point, eveything works fine.
Then when I try to launch another process with th... | Matplotlib with multiprocessing freeze computer | 0.099668 | 0 | 0 | 1,823 |
31,344,931 | 2015-07-10T15:41:00.000 | 1 | 0 | 1 | 0 | python,django,debugging,pip,virtualenv | 31,349,989 | 1 | true | 0 | 0 | There is no magic way to see what packages are actually in use. The easiest option would be:
Create and activate a new, empty virtualenv.
Try to run your code. When it fails because of a missing dependency, pip install the missing package.
Repeat step 2 until everything works.
pip freeze > requirements.txt to recor... | 1 | 1 | 0 | I am still in my dev environment (in a virtual environment), So I have installed some pip packages to test or trying ways to do something. Now I am wondering if it is possible to find out which of those modules are really in use. Thanks in advance. | Find out which PIP modules are really in use | 1.2 | 0 | 0 | 62 |
31,346,102 | 2015-07-10T16:41:00.000 | 0 | 0 | 0 | 1 | python,amazon-web-services,amazon-s3,amazon-emr,amazon-data-pipeline | 31,363,788 | 1 | false | 0 | 0 | First thing you want to do is to set 'termination protection' on - on the EMR cluster -as soon as it is launched by Data Pipeline. (this can be scripted too).
Then you can log on to the 'Master instance'. This is under 'hardware' pane under EMR cluster details. (you can also search in EC2 console by cluster id). ... | 1 | 1 | 0 | I am trying to create a basic ETL on AWS platform, which uses python.
In a S3 bucket (lets call it "A") I have lots of raw log files, gzipped.
What I would like to do is to have it periodically (=data pipeline) unzipped, processed by a python script which will reformat the structure of every line, and output it to anot... | AWS ETL with python scripts | 0 | 0 | 0 | 671 |
31,346,625 | 2015-07-10T17:13:00.000 | 1 | 0 | 0 | 0 | python,xml,lxml,docx,python-docx | 31,349,163 | 1 | false | 0 | 0 | You probably need to be more specific, but the short answer is, in principle, yes.
At a certain level, all python-docx does is modify strings in the XML. A couple things though:
The XML you create needs to remain well-formed and valid according to the schema. So if you change the text enclosed in a <w:t> element, for ... | 1 | 2 | 0 | I want to enter data into a Microsoft Excel Spreadsheet, and for that data to interact and write itself to other documents and webforms.
With success, I am pulling data from an Excel spreadsheet using xlwings. Right now, I’m stuck working with .docx files. The goal here is to write the Excel data into specific part... | Can you modify only a text string in an XML file and still maintain integrity and functionality of .docx encasement? | 0.197375 | 1 | 0 | 581 |
31,347,339 | 2015-07-10T17:58:00.000 | 0 | 0 | 0 | 1 | python,windows,csv | 31,347,743 | 2 | true | 0 | 0 | Damn it, it's already working!, it has been like saying i cannot find my glasses and to have them on.
THanks Brian, it wasn't that the error. The problem was that in my code i was dealing with ubuntu separator besides the full path to the csv output file was completely correct. But I replaced it with os.sep , and start... | 1 | 0 | 0 | I have to run my python script on windows too, and then it began the problems.
Here I'm scraping html locally saved files, and then saving their .csv versions with the data I want. I ran it on my ubuntu and goes for +100k files with no problems. But when I go on windows, it says:
IOError: [Errno 13] Permission denied ... | python astonishing IOError on windows creating files - Errno 13 Permission | 1.2 | 0 | 0 | 786 |
31,349,125 | 2015-07-10T19:48:00.000 | 0 | 0 | 0 | 0 | django,python-2.7,django-templates,django-views | 31,349,275 | 2 | true | 1 | 0 | Message is plain text, while html_message is a message formatted using HTML. If you set both, probably your email client is displaying the HTML version. | 1 | 3 | 0 | When im trying to send a mail with django send mail only the html message is coming and not the normal message i want to know the difference between both.
Is there any best way to send mails through template or html files because i want a comming mailing system in my app.
Note:- the difference is of more important.
T... | what is the difference between django html_message and message in send mail | 1.2 | 0 | 0 | 905 |
31,350,335 | 2015-07-10T21:10:00.000 | 1 | 0 | 0 | 1 | linux,centos,docker,ipython-notebook | 31,355,539 | 5 | false | 0 | 0 | @maybeg's answer already explains very well why this might be happening.
Regarding stopping the unresponsive container, another solution is to simply issue a docker stop <container-id> in another terminal. As opposed to CTRL-C, docker stop does not send a SIGINT but a SIGTERM signal, to which the process might react d... | 1 | 22 | 0 | Having an issue with Docker at the moment; I'm using it to run an image that launches an ipython notebook on startup. I'm looking to make some edits to ipython notebook itself, so I need to close it after launch.
However, hitting CTRL+C in the terminal just inputs "^C" as a string. There seems to be no real way of usin... | Docker not responding to CTRL+C in terminal | 0.039979 | 0 | 0 | 14,239 |
31,353,137 | 2015-07-11T03:31:00.000 | 0 | 0 | 0 | 0 | python,heroku,pyodbc | 61,108,863 | 7 | false | 1 | 0 | RedHat/CentOS:
dnf install -y unixODBC-devel
along with unixODBC installation | 4 | 83 | 0 | I'm trying to install PyODBC on Heroku, but I get fatal error: sql.h: No such file or directory in the logs when pip runs. How do I fix this error? | sql.h not found when installing PyODBC on Heroku | 0 | 1 | 0 | 62,898 |
31,353,137 | 2015-07-11T03:31:00.000 | 1 | 0 | 0 | 0 | python,heroku,pyodbc | 59,790,771 | 7 | false | 1 | 0 | I recently saw this error in Heroku. To fix this problem I took the following steps:
Add Apt File to the root folder, with the following:
unixodbc
unixodbc-dev
python-pyodbc
libsqliteodbc
Commit that
Run heroku buildpacks:clear
Run heroku buildpacks:add --index 1 heroku-community/apt
Push to Heroku
For me the problem... | 4 | 83 | 0 | I'm trying to install PyODBC on Heroku, but I get fatal error: sql.h: No such file or directory in the logs when pip runs. How do I fix this error? | sql.h not found when installing PyODBC on Heroku | 0.028564 | 1 | 0 | 62,898 |
31,353,137 | 2015-07-11T03:31:00.000 | 1 | 0 | 0 | 0 | python,heroku,pyodbc | 47,557,567 | 7 | false | 1 | 0 | The other answers are more or less correct; you're missing the unixodbc-dev[el] package for your operating system; that's what pip needs in order to build pyodbc from source.
However, a much easier option is to install pyodbc via the system package manager. On Debian/Ubuntu, for example, that would be apt-get install p... | 4 | 83 | 0 | I'm trying to install PyODBC on Heroku, but I get fatal error: sql.h: No such file or directory in the logs when pip runs. How do I fix this error? | sql.h not found when installing PyODBC on Heroku | 0.028564 | 1 | 0 | 62,898 |
31,353,137 | 2015-07-11T03:31:00.000 | 8 | 0 | 0 | 0 | python,heroku,pyodbc | 31,358,757 | 7 | false | 1 | 0 | You need the unixODBC devel package. I don't know what distro you are using but you can google it and build from source. | 4 | 83 | 0 | I'm trying to install PyODBC on Heroku, but I get fatal error: sql.h: No such file or directory in the logs when pip runs. How do I fix this error? | sql.h not found when installing PyODBC on Heroku | 1 | 1 | 0 | 62,898 |
31,354,140 | 2015-07-11T06:24:00.000 | 1 | 0 | 1 | 0 | python | 31,355,098 | 2 | false | 0 | 0 | Using global variables has its problems in general:
Passing variables as parameters to functions e.g. more flexible and readable than having functions access globals.
In case of a network of connected objects, it's usually more flexible for objects to have members referring to other objects then for them to access oth... | 1 | 0 | 0 | There are many posts where I got to use the case of __init__.py and use to define global variable is one of them.
But I want to know is there any demerit in defining a local variable in __init__.py ? | Defining any variable in __init__.py | 0.099668 | 0 | 0 | 1,315 |
31,361,738 | 2015-07-11T20:54:00.000 | 0 | 0 | 1 | 0 | python,django,intellij-idea,pycharm | 31,439,322 | 1 | true | 1 | 0 | For version 4.5.3 only. The issue is with the Django Settings file, in TEMPLATES. It's a bug with the DIRS of TEMPLATES. See bug report. I commented out the TEMPLATES and it worked for me. | 1 | 0 | 0 | After upgrading 4.5.3 my Tools->Run manage.py task no longer works. Clicking on the link does nothing. No window pops up. Going to "Python Console" does not work, same thing, nothing happens.
Going to Django in "Languages and Frameworks" and deselecting django allows the "python console" to properly work as a python... | PyCharm 4.5.3 Django manage.py task not working after update | 1.2 | 0 | 0 | 902 |
31,362,573 | 2015-07-11T22:43:00.000 | 10 | 0 | 0 | 0 | python,performance,csv,pandas,dataframe | 43,903,727 | 2 | false | 0 | 0 | I've found that CSV and tab-delimited text (.txt) are equivalent in read and write speed, both are much faster than reading and writing MS Excel files. However, Excel format compresses the file size a lot.
For the same 320 MB CSV file (16 MB .xlsx)
(i7-7700k, SSD, running Anaconda Python 3.5.3, Pandas 0.19.2)
Using t... | 2 | 15 | 1 | I tend to import .csv files into pandas, but sometimes I may get data in other formats to make DataFrame objects.
Today, I just found out about read_table as a "generic" importer for other formats, and wondered if there were significant performance differences between the various methods in pandas for reading .csv file... | Performance difference in pandas read_table vs. read_csv vs. from_csv vs. read_excel? | 1 | 0 | 0 | 20,524 |
31,362,573 | 2015-07-11T22:43:00.000 | 28 | 0 | 0 | 0 | python,performance,csv,pandas,dataframe | 31,362,987 | 2 | true | 0 | 0 | read_table is read_csv with sep=',' replaced by sep='\t', they are two thin wrappers around the same function so the performance will be identical. read_excel uses the xlrd package to read xls and xlsx files into a DataFrame, it doesn't handle csv files.
from_csv calls read_table, so no. | 2 | 15 | 1 | I tend to import .csv files into pandas, but sometimes I may get data in other formats to make DataFrame objects.
Today, I just found out about read_table as a "generic" importer for other formats, and wondered if there were significant performance differences between the various methods in pandas for reading .csv file... | Performance difference in pandas read_table vs. read_csv vs. from_csv vs. read_excel? | 1.2 | 0 | 0 | 20,524 |
31,364,301 | 2015-07-12T04:14:00.000 | 1 | 0 | 1 | 0 | python,regex | 31,364,349 | 2 | false | 0 | 0 | Raw strings are still useful for writing characters like \ without escaping them. This is generally useful in regex and window paths etc. | 1 | 0 | 0 | In Python 2, when dealing with regular expression we use r'expression', do we still need prepend "r" in Python 3, since I know Python 3 use Unicode by default | Does Python3 still need raw string in regular expression? | 0.099668 | 0 | 0 | 706 |
31,364,987 | 2015-07-12T06:16:00.000 | 0 | 0 | 0 | 0 | python,python-2.7,user-interface,python-3.x,tkinter | 31,366,766 | 1 | true | 0 | 1 | If you want to validate the data when the widget loses focus, you would simply bind a function to the <FocusOut> event. | 1 | 0 | 0 | There is a command validatecommand in Entry widget. But there is not a simulated command in Text widget.
How to implement the function in Text widget in tkinter? | How to validate the content of a Text widget while this Text widget loses focus? | 1.2 | 0 | 0 | 39 |
31,365,093 | 2015-07-12T06:36:00.000 | 0 | 0 | 1 | 0 | python,ipython,pycharm,ipython-notebook | 42,631,771 | 1 | true | 0 | 0 | You must start IPython Notebook from Pycharm's run
Find the IPython path (ex which ipython on linux). Copy the resulting path, we will need it!
On PyCharm go to Run > Edit Configuration > + button on top left most corner (add configuration) > Choose Python.
Give your configuration a name.
On the configuration tab, i... | 1 | 2 | 0 | I'd like to know how to set breakpoints in IPython notebook on PyCharm.
If it's possible, please let me know. | Can PyCharm set breakpoints on ipython notebook? | 1.2 | 0 | 0 | 447 |
31,368,383 | 2015-07-12T13:41:00.000 | 0 | 0 | 1 | 0 | python,kivy | 31,368,591 | 2 | false | 0 | 1 | Just open('filename') - the path is relative, so if its in the same directory you don't have to do anything special.
If this appears not to work, perhaps it isn't your syntax that is the issue. | 1 | 0 | 0 | Is there any easy method for opening the text file if you are running your app from the same directory? I can't seem to find anything easy.
I am asking because you can do that with most of the things in kivy (for image: "name.png", for .kv: load_kv("name.kv") and so on) and I don't understand why it wouldn't be simila... | Open (read, write) a file in same directory as main app - python/kivy | 0 | 0 | 0 | 1,130 |
31,368,710 | 2015-07-12T14:15:00.000 | 11 | 0 | 1 | 0 | python,file | 58,131,092 | 5 | false | 0 | 0 | import numpy as np
data = np.load('imdb.npz', allow_pickle=True)
lst = data.files
for item in lst:
print(item)
print(data[item]) | 1 | 40 | 0 | Someone sent me an .npz file. How can I open that file using Python, and read the data from it? | How to open an .npz file | 1 | 0 | 0 | 83,162 |
31,369,558 | 2015-07-12T15:40:00.000 | 0 | 0 | 0 | 0 | python,postgresql | 31,371,403 | 1 | false | 0 | 0 | The "right" way to do this is to have a separate table of ticket
assignments. Converting the data for something like this is fairly simple on the database end. create table assign as select tech_id from ... followed by creating any necessary foreign key constraints.
Rewriting your interface code can be trickier, but y... | 1 | 0 | 0 | We have a ticket software to manage our work, every ticket is assigned to a tech in one field -the normal stuff-, but now we want to assign the same ticket to several technicians eg: tick 5432: tech_id(2,4,7) where 2,4,7 are tech IDs.
Of course we can do that using a separate table with the IDs of the tech and the tick... | Is any variable in PostgreSQL to store a list | 0 | 1 | 0 | 136 |
31,369,633 | 2015-07-12T15:49:00.000 | 2 | 0 | 0 | 0 | python,ssl,https,python-requests,client-certificates | 31,370,879 | 1 | false | 0 | 0 | This is actually trivial... CA_BUNDLE can be any file that you append certificates to, so you can simply append the output of ssl.get_server_certificate() to that file and it works. | 1 | 2 | 0 | I'm using requests to communicate with remote server over https. At the moment I'm not verifying SSL certificate and I'd like to fix that.
Within requests documentation, I've found that:
You can pass verify the path to a CA_BUNDLE file with certificates of
trusted CAs. This list of trusted CAs can also be specified ... | Adding server certificates to CA_BUNDLE in python | 0.379949 | 0 | 1 | 5,838 |
31,370,089 | 2015-07-12T16:36:00.000 | 0 | 0 | 1 | 0 | python,setup.py | 31,370,168 | 1 | true | 0 | 0 | In most cases, setup.py installs code into locations already along sys.path (which may or may not exist along PYTHONPATH). It doesn't modify PYTHONPATH or sys.path.
Generally, the input paths listed in setup.py are assumed to be relative to the setup.py script. For packages and modules, the output paths (where files ar... | 1 | 1 | 0 | When I download a package and run python setup.py install, the package becomes importable. What does the command do that makes the code importable? | What does setup.py install do to make code importable? | 1.2 | 0 | 0 | 118 |
31,370,534 | 2015-07-12T17:25:00.000 | 0 | 0 | 0 | 0 | python,django,oauth-2.0,google-oauth,django-allauth | 31,370,619 | 2 | false | 1 | 0 | One option is that the primary form pops up social auth in a new window then uses AJAX to poll for whether the social auth has completed. As long as you are fine with the performance characteristics of this (it hammers your server slightly), then this is probably the simplest solution. | 2 | 2 | 0 | I'm using django 1.8.3 and django-allauth 0.21.0 and I'd like the user to be able to log in using e.g. their Google account without leaving the page. The reason is that there's some valuable data from the page they're logging in from that needs to be posted after they've logged in. I've already got this working fine us... | Social login in using django-allauth without leaving the page | 0 | 0 | 0 | 610 |
31,370,534 | 2015-07-12T17:25:00.000 | 1 | 0 | 0 | 0 | python,django,oauth-2.0,google-oauth,django-allauth | 32,250,705 | 2 | true | 1 | 0 | I ended up resolving this by using Django's session framework. It turns out that the session ID is automatically passed through the oauth procedure by django-allauth, so anything that's stored in request.session is accessible on the other side after login is complete. | 2 | 2 | 0 | I'm using django 1.8.3 and django-allauth 0.21.0 and I'd like the user to be able to log in using e.g. their Google account without leaving the page. The reason is that there's some valuable data from the page they're logging in from that needs to be posted after they've logged in. I've already got this working fine us... | Social login in using django-allauth without leaving the page | 1.2 | 0 | 0 | 610 |
31,373,742 | 2015-07-12T23:56:00.000 | 0 | 0 | 1 | 0 | python,range,execution,maya | 31,374,327 | 3 | false | 0 | 0 | This is not possible in Python with Python source code.
Instead, split the code to functions and then call individual functions. E.g. make a function out lines 20 - 45. | 2 | 1 | 0 | It is possible to execute some lines range in a single command in Maya scripting editor? (I'm using Python)
The idea is very clear
Regularly the user needs to select some parts of the code when he/she is debugging. Let's say, for example, from line 20 to line 45 from the current tab in script editor (obviously).
The qu... | Exec lines range in Maya script editor | 0 | 0 | 0 | 431 |
31,373,742 | 2015-07-12T23:56:00.000 | 0 | 0 | 1 | 0 | python,range,execution,maya | 31,375,812 | 3 | false | 0 | 0 | You can use the python exec statement to try and execute the lines from the history that are selected. However the utility of this is going to be extremely limited, since those lines won't do the same thing in exec that they would inside a function: they won't have access to variables defined outside that selection, ... | 2 | 1 | 0 | It is possible to execute some lines range in a single command in Maya scripting editor? (I'm using Python)
The idea is very clear
Regularly the user needs to select some parts of the code when he/she is debugging. Let's say, for example, from line 20 to line 45 from the current tab in script editor (obviously).
The qu... | Exec lines range in Maya script editor | 0 | 0 | 0 | 431 |
31,375,628 | 2015-07-13T04:56:00.000 | 1 | 1 | 0 | 1 | python,shell,unix,vim | 31,391,726 | 1 | false | 0 | 0 | When you do :! in Vim, you effectively put Vim into background and the running process, in this case py.test, gets the focus. That means you can't tell Vim to kill the process for you since Vim is not getting keystrokes from you.
Ctrl-Z puts Vim into background while running py.test because Vim is the parent process of... | 1 | 3 | 0 | I'm writing some threaded python code in vim. When I run my tests, with
:! py.test test_me.py
Sometimes they hang and cannot be killed with ctrl-C. So I have to background vim (actually the shell the tests are running in) and pkill py.test. Is there a better way to kill the hanging test suite?
I tried mapping :map ,k:... | kill a shell created by vim when ctrl-C doesn't work | 0.197375 | 0 | 0 | 371 |
31,377,196 | 2015-07-13T07:01:00.000 | 0 | 1 | 0 | 0 | python,frameworks,erpnext,frappe | 31,379,032 | 3 | false | 1 | 0 | bench clear-cache will clear the cache. After doing this, refresh and check. | 3 | 0 | 0 | ERPNext + frappe need to change layout(footer & header) front-end. I tried to change base.html(frappe/templates/base.html) but nothing happened. Probably this is due to the fact that the html files need to somehow compile. Maybe someone have info how to do it?
UPDATE:
No such command "clear-cache".
Commands:
backup
... | Customize frappe framework html layout | 0 | 0 | 0 | 1,663 |
31,377,196 | 2015-07-13T07:01:00.000 | 0 | 1 | 0 | 0 | python,frameworks,erpnext,frappe | 58,808,805 | 3 | false | 1 | 0 | It seems you're not in your bench folder.
When you create a new bench with, for example : bench init mybench it creates a new folder : mybench.
All bench commands must be run from this folder.
Could you try to run bench --help in this folder ? You should see the clear-cache command. | 3 | 0 | 0 | ERPNext + frappe need to change layout(footer & header) front-end. I tried to change base.html(frappe/templates/base.html) but nothing happened. Probably this is due to the fact that the html files need to somehow compile. Maybe someone have info how to do it?
UPDATE:
No such command "clear-cache".
Commands:
backup
... | Customize frappe framework html layout | 0 | 0 | 0 | 1,663 |
31,377,196 | 2015-07-13T07:01:00.000 | 0 | 1 | 0 | 0 | python,frameworks,erpnext,frappe | 68,402,268 | 3 | false | 1 | 0 | If anyone stumbles on this. The command needed is bench build. That will compile any assets related to the build.json file in the public folder. (NOTE: You usually have to create build.json yourself). | 3 | 0 | 0 | ERPNext + frappe need to change layout(footer & header) front-end. I tried to change base.html(frappe/templates/base.html) but nothing happened. Probably this is due to the fact that the html files need to somehow compile. Maybe someone have info how to do it?
UPDATE:
No such command "clear-cache".
Commands:
backup
... | Customize frappe framework html layout | 0 | 0 | 0 | 1,663 |
31,378,288 | 2015-07-13T08:08:00.000 | 0 | 0 | 0 | 1 | google-app-engine,middleware,google-app-engine-python | 31,397,559 | 1 | false | 1 | 0 | The way I approached such scenario (in a python-only project, donno about php) was to use a custom handler (inheriting webapp2.RequestHandler which I was already using for session support). In its customized dispatch() method the user info is collected and stored in the handler object itself.
The implementation of the ... | 1 | 0 | 0 | Assume that I have few modules on my GAE project (say A, B, C). They shares the users database and sessions.
For example: module A will manage the login/logout actions (through cookies), module B,C will handle other actions. FYI, those modules are developed in both PHP and Python.
Now, I do not want to make user & sess... | GAE middlewares for modules? | 0 | 0 | 0 | 59 |
31,384,639 | 2015-07-13T13:25:00.000 | 0 | 0 | 1 | 0 | python | 68,257,290 | 5 | false | 0 | 0 | On my CentOS7.9 Linux (a RedHat clone) it is found in ~/.local/lib/python3.9/site-packages/ and there is no need to include it in the PYTHONPATH variable. | 1 | 176 | 0 | The directory site-packages is mentioned in various Python related articles. What is it? How to use it? | What is python's site-packages directory? | 0 | 0 | 0 | 196,583 |
31,385,363 | 2015-07-13T13:56:00.000 | 0 | 0 | 0 | 0 | python,apache-spark,dataframe,apache-spark-sql,export-to-csv | 69,462,087 | 9 | false | 0 | 0 | try display(df) and use the download option in the results. Please note: only 1 million rows can be downloaded with this option but its really quick. | 1 | 106 | 1 | I am using Spark 1.3.1 (PySpark) and I have generated a table using a SQL query. I now have an object that is a DataFrame. I want to export this DataFrame object (I have called it "table") to a csv file so I can manipulate it and plot the columns. How do I export the DataFrame "table" to a csv file?
Thanks! | How to export a table dataframe in PySpark to csv? | 0 | 1 | 0 | 340,481 |
31,387,311 | 2015-07-13T15:22:00.000 | 0 | 0 | 1 | 0 | python,kivy | 31,411,920 | 2 | false | 0 | 1 | root is global to every widget rule and refers to the top most widget which in most cases is the instance of the class... | 1 | 1 | 0 | What is the scope of root if I have a custom widget embedded in another custom widget? Is there a rule of thumb to avoid confusion? | Scope of root in kivy language | 0 | 0 | 0 | 199 |
31,387,660 | 2015-07-13T15:39:00.000 | 0 | 0 | 0 | 0 | kivy,qpython,qpython3 | 31,388,789 | 2 | true | 0 | 1 | Edit: Kivy now supports python3 on Android, though qpython would still have to include this (or a similar build process) to have kivy work in qpython3.
You can't right now, as kivy does not have a python3-supporting backend on android.
We're working towards adding one, at which point I quess qpython may look at adding ... | 1 | 0 | 0 | How I can use the Kivy framework in Qpython3 (Python 3.2 for android) app?
I know that Qpython (Python 2.7 for android) app support this framework.
pip_console don't install kivy. I have an error, when I try to install it. Please help me. | Kivy on Qpython3 (Android) | 1.2 | 0 | 0 | 6,003 |
31,387,762 | 2015-07-13T15:44:00.000 | 0 | 0 | 0 | 0 | javascript,python,django,timer | 31,387,864 | 3 | true | 1 | 0 | The only secure way would be to put the logic on the server that checks the time. Make an Ajax call to the server. If the time is under 5 seconds, do not return the HTML, if it is greater than , than return the html to show.
Other option is to have the link point to your server and if the time is less than five second... | 2 | 0 | 0 | I know how to do that with javascript but I need a secure way to do it.
Anybody can view page source, get the link and do not wait 5 seconds.
Is there any solution? I'm working with javascript and django.
Thanks! | Wait 5 seconds before download button appear | 1.2 | 0 | 0 | 1,293 |
31,387,762 | 2015-07-13T15:44:00.000 | 0 | 0 | 0 | 0 | javascript,python,django,timer | 31,388,190 | 3 | false | 1 | 0 | Use server side timeout.. whenever there is (AJAX) request from client for download link with timestamp, compare the client sent timestamp with currenttime and derive how much time is required to halt the request at server side to make up ~5 seconds. So by comparing timestamp you can almost achieve accuracy of waiting ... | 2 | 0 | 0 | I know how to do that with javascript but I need a secure way to do it.
Anybody can view page source, get the link and do not wait 5 seconds.
Is there any solution? I'm working with javascript and django.
Thanks! | Wait 5 seconds before download button appear | 0 | 0 | 0 | 1,293 |
31,388,220 | 2015-07-13T16:05:00.000 | 0 | 0 | 0 | 0 | python,amazon-web-services | 31,411,856 | 1 | false | 0 | 0 | Unlike row-based systems, which are ideal for transaction processing, column-based systems (Redshift) are ideal for data warehousing and analytics, where queries often involve aggregates performed over large data sets. Since only the columns involved in the queries are processed and columnar data is stored sequentially... | 1 | 0 | 0 | I have a fairly large redshift table with around 200 million records. I would like to update the values in one of the columns using a user-defined python function. If I run the function in an EC2 instance, it results in millions of updates to the table, and it is very slow. Is there a better process for me to speed ... | How to increase performance of large number of updates to a redshift table with python functions | 0 | 1 | 0 | 56 |
31,390,838 | 2015-07-13T18:32:00.000 | 0 | 0 | 0 | 0 | python,classification,word2vec | 31,619,724 | 2 | false | 0 | 0 | For a multi-class classification problem of sentences, doc2vec can work just fine, since context rarely changes a lot within the sentence.
If you want to use only python, I will recommend, doc2vec (for building features) followed by xgboost (for training classifier), which has worked for me in similar problems. | 2 | 1 | 1 | I want to build a classifier for forum posts that will automatically categorize these
posts into some defined categories(so multiclass classification not only binary
classification) by using semantic word representations. For this task I want to make use
of word2vec and doc2vec and check the feasability of using these ... | Using semantic word representation (e.g. word2vec) to build a classifier | 0 | 0 | 0 | 1,109 |
31,390,838 | 2015-07-13T18:32:00.000 | 2 | 0 | 0 | 0 | python,classification,word2vec | 31,393,600 | 2 | true | 0 | 0 | The issue with things like word2vec/doc2vec and so on - actually any usupervised classifier - is that it just uses context. So, for example if I have a sentence like "Today is a hot day" and another like "Today is a cold day" it thinks hot and cold are very very similar and should be in the same cluster.
This makes it ... | 2 | 1 | 1 | I want to build a classifier for forum posts that will automatically categorize these
posts into some defined categories(so multiclass classification not only binary
classification) by using semantic word representations. For this task I want to make use
of word2vec and doc2vec and check the feasability of using these ... | Using semantic word representation (e.g. word2vec) to build a classifier | 1.2 | 0 | 0 | 1,109 |
31,391,729 | 2015-07-13T19:22:00.000 | 1 | 0 | 0 | 0 | python,csv,selenium,screenshot | 31,391,856 | 1 | false | 0 | 0 | Selenium tests in Python are just python code. You can use the CSV module and a normal loop to carry out these actions on the page, and receive the values from the new DOM.
You can use loops just like normal Python to capture the screenshots, but no I'm not going to write the code for ya. | 1 | 0 | 0 | Can someone let me know
1. How to write selenium webdriver code in python for reading the data from CSV files and input them into fields of application under test and print the results into CSV file after execution.
2. I have written capture screenshot for every statement to get the screenshots.
Is there any that we c... | Selenium webdriver code for reading/Writing data from CSV in Python | 0.197375 | 0 | 1 | 629 |
31,392,285 | 2015-07-13T19:56:00.000 | 3 | 0 | 0 | 0 | python,postgresql,sqlalchemy,alembic | 31,392,595 | 3 | false | 0 | 0 | This works for me:
1) Access your session, in the same way you did session.create_all, do session.drop_all.
2) Delete the migration files generated by alembic.
3) Run session.create_all and initial migration generation again. | 1 | 7 | 0 | Everything I found about this via searching was either wrong or incomplete in some way. So, how do I:
delete everything in my postgresql database
delete all my alembic revisions
make it so that my database is 100% like new | Clear postgresql and alembic and start over from scratch | 0.197375 | 1 | 0 | 7,991 |
31,393,074 | 2015-07-13T20:42:00.000 | 0 | 0 | 1 | 0 | python,user-interface,wxpython,toolbar,wxwidgets | 31,393,184 | 1 | false | 0 | 1 | No. That widget is part of the toolbar. Just use a BitmapButton or a PlateButton. They both support images and would be more flexible to use anyway. | 1 | 0 | 0 | I want to create a ToolBarToolBase object without adding it visibly to the toolbar. I've tried instantiating ToolBarToolBase, but I'm using wxPython version 2.8.12.1 (I can't upgrade, I'm doing this for work) so I don't think it's fully implemented. Is there any way to do this? | wxPython Create a LabelTool without adding it to a Toolbar | 0 | 0 | 0 | 25 |
31,396,712 | 2015-07-14T02:36:00.000 | 4 | 1 | 0 | 0 | python,import.io | 31,427,417 | 2 | false | 0 | 0 | One slightly less elegant solution would be to create a crawler. And before you run it insert the the 10k URLs in the "where to start crawling" box.
Under advanced options set the crawl depth to zero, that way you will only get the pages you put in the where to start crawling input box.
That should do the trick. Plus t... | 2 | 4 | 0 | I have set up an Import.io bulk extract that works great with say, 50 URLs. It literally zips through all of them in seconds. However, when I try to do an extract of 40,000 URLs, the extractor starts very fast for the first thousand or so, and then progressively keeps getting slower every incremental URL. By 5,000 it l... | Import.io bulk extract slows down when more URLs are in list | 0.379949 | 0 | 1 | 155 |
31,396,712 | 2015-07-14T02:36:00.000 | 0 | 1 | 0 | 0 | python,import.io | 32,215,417 | 2 | false | 0 | 0 | Mike, would you mind trying again?
We have worked on the Bulk Extract, now it should be slightly slower at the beginning, but more constant
Possibly 40k are still too many, in which case you may try to split, but I did run 5k+ in a single run
Let me know how it goes! | 2 | 4 | 0 | I have set up an Import.io bulk extract that works great with say, 50 URLs. It literally zips through all of them in seconds. However, when I try to do an extract of 40,000 URLs, the extractor starts very fast for the first thousand or so, and then progressively keeps getting slower every incremental URL. By 5,000 it l... | Import.io bulk extract slows down when more URLs are in list | 0 | 0 | 1 | 155 |
31,397,675 | 2015-07-14T04:30:00.000 | 0 | 0 | 1 | 0 | python,linux,ubuntu | 31,399,878 | 1 | false | 0 | 0 | try pip freeze to find whether the module numpy is installed, If its not then try pip install numpy, also check weather in the environmental variable that the /Scripts is added because that's where all the packages reside. | 1 | 0 | 1 | Currently I am trying to import numpy using the python command but I am getting the error which is:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named numpy
I have already installed the latest version of numpy and my python version is 2.7.10. | Cannot import python-numpy using Ubuntu | 0 | 0 | 0 | 103 |
31,399,631 | 2015-07-14T06:50:00.000 | 0 | 0 | 0 | 0 | python,events,binding,tkinter,mouse | 31,418,783 | 1 | false | 0 | 1 | No, you can't bind to "mouse stopped moving". However, you can bind to <B1-Motion>, and with each callback set a timer to run in the future. If the mouse hasn't moved within that time the function will be called. Within that function you could use event_generate to generate a custom <<MouseStopped>> event. If the mouse... | 1 | 0 | 0 | Is it possible to trigger a function when the mouse stop moving?
For example, I have a scale, and I want to trigger a function when I still holding a button and stop dragging. I used 'ButtonRelease-1' but I had to release a mouse button to be able to trigger a function, it's not what I want.
Hope you guys can help me.
... | Binding mouse events on 'stop' motion in tkinter python3 | 0 | 0 | 0 | 753 |
31,399,735 | 2015-07-14T06:56:00.000 | 0 | 0 | 0 | 1 | python,tornado | 31,399,949 | 2 | false | 0 | 0 | Only way u can change function parse_body_arguments in tornado.httputil file. Otherwise remove Content-Encoding in headers arguments | 2 | 2 | 0 | I'm processing requests in Tornado that comes with Content-Encoding: gzip header in the body request. The problem is that Tornado shows a warning:
[W 150713 17:22:11 httputil:687] Unsupported Content-Encoding: gzip
I'm doing the unzip operation inside the code and it works like a charm but I'd like to get rid of the ... | Accept "Content-Encoding: gzip" in Tornado | 0 | 0 | 0 | 1,594 |
31,399,735 | 2015-07-14T06:56:00.000 | 4 | 0 | 0 | 1 | python,tornado | 31,408,024 | 2 | false | 0 | 0 | You must opt-in to handling of gzipped requests by passing decompress_request=True to the HTTPServer constructor (or Application.listen). | 2 | 2 | 0 | I'm processing requests in Tornado that comes with Content-Encoding: gzip header in the body request. The problem is that Tornado shows a warning:
[W 150713 17:22:11 httputil:687] Unsupported Content-Encoding: gzip
I'm doing the unzip operation inside the code and it works like a charm but I'd like to get rid of the ... | Accept "Content-Encoding: gzip" in Tornado | 0.379949 | 0 | 0 | 1,594 |
31,401,890 | 2015-07-14T08:44:00.000 | 2 | 0 | 1 | 0 | ipython-notebook | 55,136,264 | 8 | false | 0 | 0 | if you are using python version 2
pip install jupyter
in case using python 3.x
pip3 install jupyter
to be on the safe side also check that notebook module is installed or not
pip install notebook
or
pip3 install notebok | 1 | 158 | 0 | What do you recommend guys for this error when I type in console ipython notebook and got
ImportError: No module named notebook.notebookapp
?
I installed ipython notebook with pip and really I don't know what is going on. | ImportError: No module named notebook.notebookapp | 0.049958 | 0 | 0 | 87,447 |
31,403,321 | 2015-07-14T09:53:00.000 | 0 | 0 | 0 | 0 | javascript,python-2.7,pdf,acrobat | 31,418,813 | 1 | false | 1 | 0 | Not possible.
And that is good so, because allowing such things would be extremely unsafe. | 1 | 0 | 0 | I'm bit new to adobe acrobat JavaScript. I was wondering if it is possible to have a click button in the pdf, once i click it, it will run a JavaScript which will run a python code automatically? Thanks in advance. | How can i use the Javascript in adobe Acrobat to run a Python Script? | 0 | 0 | 0 | 169 |
31,406,106 | 2015-07-14T12:05:00.000 | -1 | 0 | 0 | 0 | python,django,testing,django-rest-framework | 31,435,440 | 3 | true | 1 | 0 | Just found the problem!!
I was using APIRequestFactory()
and should have been using the build in client factory from the APITestCase test class from Django Rest Framework | 1 | 4 | 0 | I want to test some views in DRF project.
The problem comes when I try to check views that have arguments in the urls.
urls.py
url(r'^(?Pcompany_hash>[\d\w]+)/(?Ptimestamp>[\.\d]*)/employees/$',
EmployeeList.as_view(), name='employeelist'),
[edit: "<" in url has been deleted in purpose, just it isnt con... | How can i correctly pass arguments to classbasedviews testing Django Rest Framework? | 1.2 | 0 | 0 | 3,215 |
31,410,922 | 2015-07-14T15:27:00.000 | 1 | 0 | 1 | 0 | python,testing,assert,assertion | 31,411,396 | 1 | false | 0 | 0 | If you're writing "public" function, I believe that pythonic way would be to check arguments (using if, not assert), and, if they're invalid, raise exception with type and info / message designed to provide as much info as possible.
If you're writing function designed for internal use, then using assert to check the ar... | 1 | 0 | 0 | I'm confused as when to exactly use assertion testing in my python functions. If I specify assumptions regarding the input arguments to a function, should I assume that correct input is being fed to the function or should I use assertions to check the conditions on the input args enumerated in the specification? | Does precondition assertion testing replace assumptions in a function specification or vice versa? | 0.197375 | 0 | 0 | 299 |
31,412,919 | 2015-07-14T17:01:00.000 | 0 | 1 | 0 | 0 | python,python-2.7,twitter | 31,413,075 | 1 | true | 0 | 0 | is there any way to constantly "listen" to a website and run some code when it updates?
If the site offers a feed or stream of updates, use it.
However, if you are looking to scrape a page and trigger code on differences, then you need to poll the site like you are doing (clumsily) with TaskScheduler. | 1 | 1 | 0 | is there any way to constantly "listen" to a website and run some code when it updates?
i'm working on earthquake data, specifically, parsing earthquake data from a site that updates and lists earthquake details in real time.
so far, my only (and clunky) solution has been to use task scheduler to run every 30 minutes, ... | constantly "listen" to website using python | 1.2 | 0 | 1 | 381 |
31,412,936 | 2015-07-14T17:01:00.000 | 0 | 0 | 0 | 0 | python,django,amazon-s3 | 31,523,646 | 1 | true | 1 | 0 | The reason my admin styles weren't loading was because I had DEBUG = True in a different settings file than my main settings file (which had DEBUG = False). | 1 | 0 | 0 | I'm using Django 1.8 with static files and also using django-offsite-storage.
When I browse the Django admin in my browser on my local machine it's requesting the CSS file /admin/css/base.css from my S3 bucket but without the hashed version. I want it to use the hashed file name version because that's what get's uploa... | How can I get my Django admin styles to load? | 1.2 | 0 | 0 | 110 |
31,417,091 | 2015-07-14T20:51:00.000 | 0 | 0 | 1 | 0 | python,list,pickle | 31,429,440 | 1 | false | 0 | 0 | If you really want to keep it simple and use something like pickle, the best thing is to use cPickle. This library is written in C and can handle bigger files and is faster than pickle. | 1 | 0 | 1 | I have a very large list that I want to write to file. My list is 2 dimensional, and each element of the list is a 1 dimensional list. Different elements of the 2 dimensional list has 1 dimensional lists of varying size.
When my 2D list was small, pickle dump worked great. But now it just gives me memory error.
Any s... | Python pickle dump memory error | 0 | 0 | 0 | 1,136 |
31,417,288 | 2015-07-14T21:01:00.000 | 4 | 0 | 1 | 0 | python,python-3.x,boolean | 31,417,397 | 8 | false | 0 | 0 | "Do nothing" isn't an option. The mathematical expression x or y must have a value (which is true if either x, y, or both is true). And x and y must have a value (which is true if and only if x and y are both true).
The way your book defines them is mathematically correct, but confusing (until you get into things like ... | 4 | 0 | 0 | I am reading about booleans in my book, and it says:
x and y------------If x is false, return x. Otherwise, return y.
x or y--------------If x is true, return x. Otherwise, return y.
This doesn't make sense to me from the everyday usage of "or" and "and"
To me, it would make sense if it said:
x and y------------If x is... | Need help understanding Booleans? | 0.099668 | 0 | 0 | 137 |
31,417,288 | 2015-07-14T21:01:00.000 | 0 | 0 | 1 | 0 | python,python-3.x,boolean | 31,417,441 | 8 | false | 0 | 0 | The first set of descriptions are shortcuts: following these will give you exactly the same results as the "usual definitions" of true and false.
But your own descriptions don't make much sense. You can't "do nothing"; you have to return some value from a comparison, either true or false. And you can't return both a an... | 4 | 0 | 0 | I am reading about booleans in my book, and it says:
x and y------------If x is false, return x. Otherwise, return y.
x or y--------------If x is true, return x. Otherwise, return y.
This doesn't make sense to me from the everyday usage of "or" and "and"
To me, it would make sense if it said:
x and y------------If x is... | Need help understanding Booleans? | 0 | 0 | 0 | 137 |
31,417,288 | 2015-07-14T21:01:00.000 | 1 | 0 | 1 | 0 | python,python-3.x,boolean | 31,417,492 | 8 | false | 0 | 0 | While the book presents it in a slightly confusing way, it is correct. Boolean logic must evaluate to either true or false.
For X and Y in order to return true they both must be true, if X is false then it returns false. If X is true then it returns Y which is either true or false and also the correct answer.
For X or... | 4 | 0 | 0 | I am reading about booleans in my book, and it says:
x and y------------If x is false, return x. Otherwise, return y.
x or y--------------If x is true, return x. Otherwise, return y.
This doesn't make sense to me from the everyday usage of "or" and "and"
To me, it would make sense if it said:
x and y------------If x is... | Need help understanding Booleans? | 0.024995 | 0 | 0 | 137 |
31,417,288 | 2015-07-14T21:01:00.000 | 0 | 0 | 1 | 0 | python,python-3.x,boolean | 31,417,701 | 8 | false | 0 | 0 | Its probably easier if you think about it in each literal case
x and y------------If x is false, return x. Otherwise, return y.
x or y--------------If x is true, return x. Otherwise, return y.
CASE 1: x = true, y = true
"if x is false, return x. Otherwise, return y."
Then this will return y which is true. This mak... | 4 | 0 | 0 | I am reading about booleans in my book, and it says:
x and y------------If x is false, return x. Otherwise, return y.
x or y--------------If x is true, return x. Otherwise, return y.
This doesn't make sense to me from the everyday usage of "or" and "and"
To me, it would make sense if it said:
x and y------------If x is... | Need help understanding Booleans? | 0 | 0 | 0 | 137 |
31,417,487 | 2015-07-14T21:12:00.000 | 16 | 0 | 0 | 0 | python,scikit-learn,classification,regression | 31,417,912 | 7 | true | 0 | 0 | That is not a built-in feature. You can "add" it by wrapping the LogisticRegression class in your own class, and adding a threshold attribute which you use inside a custom predict() method.
However, some cautions:
The default threshold is actually 0. LogisticRegression.decision_function() returns a signed distance to ... | 1 | 29 | 1 | I am using LogisticRegression from the sklearn package, and have a quick question about classification. I built a ROC curve for my classifier, and it turns out that the optimal threshold for my training data is around 0.25. I'm assuming that the default threshold when creating predictions is 0.5. How can I change this ... | sklearn LogisticRegression and changing the default threshold for classification | 1.2 | 0 | 0 | 39,588 |
31,417,491 | 2015-07-14T21:12:00.000 | 2 | 0 | 1 | 0 | ipython,ipython-notebook,jupyter,ipython-magic | 31,419,788 | 1 | true | 0 | 0 | the difference is that kernel are native, ie, Kernels are processes that speak a protocol that allow remote execution and code completions. So you can hence an R kernel, purely in R, and a julia Kernel, purely in Julia.
in the other hand, magics (%%R, %%fortran) are at the beginning Python-only, they ask the Python ke... | 1 | 0 | 0 | In Jupyter, kernels provide support for different languages we want to use in the notebook (such as IRkernel). How is this different from using the magics to write in other languages (%load_ext rmagic and using %%R throughout the code)? | Extensions Vs Kernels in IPython | 1.2 | 0 | 0 | 181 |
31,420,095 | 2015-07-15T01:39:00.000 | 1 | 0 | 0 | 0 | python,numpy,pandas | 31,422,570 | 1 | true | 0 | 0 | It seems that you have a list of int in your data frame. To convert it to you need to select the value inside and form data frame.
I suggest you this code to convert
for col in df:
df[col] = df[col].apply(lambda x: x[0]) | 1 | 0 | 1 | I am learning the book Python for Data Analysis, after running the code from the book I got a pandas dataframe diversity like this:
sex F M
year
1880 [38] [14]
1881 [38] [14]
When I want to use diversity.plot() to draw some pictures, there is TypeError:
Empty 'DataFrame': no numeric data to plot
So, my question ... | How to make dataframe in pandas as numeric? | 1.2 | 0 | 0 | 352 |
31,420,879 | 2015-07-15T03:16:00.000 | 2 | 0 | 0 | 1 | python,io,parallel-processing,netcdf | 31,568,148 | 2 | false | 0 | 0 | It's too bad PyPnetcdf is not a bit more mature. I see hard-coded paths and abandoned domain names. It doesn't look like it will take a lot to get something compiled, but then there's the issue of getting it to actually work...
in setup.py you should change the library_dirs_list and include_dirs_list to point to the... | 1 | 5 | 0 | Is there any way of doing parallel IO for Netcdf files in Python?
I understand that there is a project called PyPNetCDF, but apparently it's old, not updated and doesn't seem to work at all. Has anyone had any success with parallel IO with NetCDF in Python at all?
Any help is greatly appreciated | Is there any parallel way of accessing Netcdf files in Python | 0.197375 | 0 | 0 | 1,241 |
31,421,793 | 2015-07-15T04:55:00.000 | 0 | 1 | 0 | 1 | python,ruby,windows,heroku,travis-ci | 31,445,471 | 1 | false | 1 | 0 | If you hadn't had Heroku Toolbelt setup to the $PATH environment variable during installation, here are some steps to check:
Check if Heroku toolbelt is set in PATH variable. If not, cd to your Heroku toolbelt installation folder, then click on the address bar and copy it.
Go to the Control Panel, then click System an... | 1 | 1 | 0 | Hi there I'm trying to deploy my python app using Travis CI but I'm running into problems when I run the "travis setup heroku" command in the cmd prompt.
I'm in my project's root directory, there is an existing ".travis.yml" file in that root directory.
I've also installed ruby correctly and travis correcty because wh... | travis setup heroku command on Windows 7 64 bit | 0 | 0 | 0 | 456 |
31,422,350 | 2015-07-15T05:46:00.000 | 1 | 0 | 1 | 0 | python,python-2.7,file-io | 31,422,893 | 3 | false | 0 | 0 | There is no function in any knows underlying file systems that allows to insert bytes into a file. You can only :
add bytes (characters) at the end of the file (append mode)
rewrite bytes in place anywhere in the file
truncate a file at current position.
So if you want to add anything not at the end of the file, the ... | 1 | 0 | 0 | I want to write a couple characters into a file where there is already text inside. What would be the code to add characters to the front of the file and to the back of the text file if I want the text that was initially in the file to remain in the center? | Python: Putting Charater in front or behind a file | 0.066568 | 0 | 0 | 52 |
31,423,456 | 2015-07-15T06:56:00.000 | 0 | 1 | 0 | 0 | python,sentry | 31,424,387 | 1 | true | 0 | 0 | If you're talking about notifications you can disable them per-account or entirely on a project via the integration.
That said if all the messages are the same you should look into why they're not grouping. A common case would be you're using a logging integration and there's a variable in the log message itself. | 1 | 0 | 0 | In case sentry sends lots of similar messages, is there a way to stop it?
We have a lot of clients and the sentry messages are basically all the same so sentry spams me. | Stop sentry from sending messages | 1.2 | 0 | 1 | 1,004 |
31,426,367 | 2015-07-15T09:20:00.000 | 0 | 0 | 0 | 0 | python,sqlite,matrix | 48,332,928 | 1 | false | 0 | 0 | As CL recommended, not to use 420 columns. I would recommend an algorithmic approach to save much processing power. Here is an example, since the size is always 390x420, have a table with 10 columns, and 16380 rows. Referencing any point on this matrix can be done with a simple algorithm, and would be much more efficie... | 1 | 0 | 0 | I have a 2D array, M 390x420 with float values in it that I would like to save as a table in a sqlite db with python. the row number of the table should be 390, the column number 420.
executemany from sqlite is not optimal because then I would have to write ~ 420 of "?" , as far as I've understood.
Thank you! | save a matrix (or a 2 dimensional array) in a sqlite db with Python | 0 | 1 | 0 | 1,249 |
31,426,536 | 2015-07-15T09:28:00.000 | -1 | 0 | 1 | 1 | python | 31,427,309 | 2 | false | 0 | 0 | You may try to read a directory directly (as a file) and pick data from there. How successfull would this be is a question of a filesystem you are on. Try first ls or dir commands to see who returns faster. os.listdir() or that funny little program. You'll se that both are in trouble. Here the key is just in that that ... | 1 | 1 | 0 | I have a huge directory that keeps getting updated all the time. I am trying to list only the latest 100 files in the directory using python. I tried using os.listdir(), but when the size of directory approaches 1,00,000 files, it seems as though listdir() crashes( or i have not waited long enough). I only need the fir... | How to copy first 100 files from a directory of thousands of files using python? | -0.099668 | 0 | 0 | 2,371 |
31,428,726 | 2015-07-15T11:07:00.000 | 1 | 0 | 1 | 0 | revit,revit-api,revitpythonshell | 31,429,221 | 3 | false | 0 | 0 | You have 2 options:
change the TransactionMode to Automatic at the class attribute
[Transaction(TransactionMode.Automatic)]
open a transaction within your command
Transaction tr = new Transaction(commandData.Application.ActiveUIDocument.Document);
tr.Start("Command name here");
// your code
tr.Commit(); | 1 | 0 | 0 | Modifying is forbidden because the document has no open transaction.
The document has no open transaction.
In Revit Document. | Revit: Modifying is forbidden because the document has no open transaction | 0.066568 | 0 | 0 | 1,586 |
31,433,422 | 2015-07-15T14:37:00.000 | 4 | 0 | 0 | 1 | python,xcode,macos,terminal | 53,036,986 | 2 | false | 0 | 0 | Try on 10.14:
sudo installer -pkg /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg -target / | 1 | 1 | 0 | I've tried pretty much everything on stackoverflow and other forums to get the /usr/include/ folder on my mac (currently using OS X 10.9.5)
Re-installed Xcode and command line tools (actually, command line tool wasn't one of the downloads available - so I'm guessing it's was already downloaded)
tried /Applications/Ins... | /usr/include folder missing in mac | 0.379949 | 0 | 0 | 3,414 |
31,435,024 | 2015-07-15T15:42:00.000 | 7 | 0 | 0 | 0 | python,scikit-learn,numba | 31,441,162 | 2 | true | 0 | 0 | Scikit-learn makes heavy use of numpy, most of which is written in C and already compiled (hence not eligible for JIT optimization).
Further, the LogisticRegression model is essentially LinearSVC with the appropriate loss function. I could be slightly wrong about that, but in any case, it uses LIBLINEAR to do the solv... | 1 | 9 | 1 | Has anyone succeeded in speeding up scikit-learn models using numba and jit compilaition. The specific models I am looking at are regression models such as Logistic Regressions.
I am able to use numba to optimize the functions I write using sklearn models, but the model functions themselves are not affected by this an... | Using Numba with scikit-learn | 1.2 | 0 | 0 | 6,532 |
31,438,478 | 2015-07-15T18:39:00.000 | 1 | 0 | 1 | 1 | python | 35,230,270 | 2 | false | 0 | 0 | If putting the file in C:\Users\<your_user> doesn't work, additionaly try setting your HOME environment variable to C:\Users\<your_user>. Worked for me.
Thanks to @WayneWerner for the solution. | 2 | 2 | 0 | I am using .pdbrc to store my debugging alias. And I want it to be available globally. Where should this file be on windows? | Where should I put the .pdbrc file on windows so that it is globally visible? | 0.099668 | 0 | 0 | 274 |
31,438,478 | 2015-07-15T18:39:00.000 | 1 | 0 | 1 | 1 | python | 31,438,577 | 2 | false | 0 | 0 | After several tries, I found it.
You can put it in C:\users\your_win_user\.pdbrc | 2 | 2 | 0 | I am using .pdbrc to store my debugging alias. And I want it to be available globally. Where should this file be on windows? | Where should I put the .pdbrc file on windows so that it is globally visible? | 0.099668 | 0 | 0 | 274 |
31,441,307 | 2015-07-15T21:18:00.000 | 0 | 1 | 0 | 0 | java,android,python,android-studio,admob | 31,441,510 | 1 | false | 1 | 0 | To access Java already implemented version you can use pyjnius. I tried to use it for something else and I didn't succeed. Well, I yielded pretty quickly because it wasn't necessary for my project.
Otherwise, I am afraid, you will have to implement it yourself from scratch.
I never heard about a finished solution for ... | 1 | 0 | 0 | I'd like to have advertisements in an android App I've written and built using PGS4A. I've done my research and all, but there doesn't seem to be any online resources that explains how to do that just yet. I haven't much knowledge on Java either, which is clearly why I've written that in Python. Has anyone found a way ... | Admob Ads with Python Subset For Android (PGS4A) | 0 | 0 | 0 | 199 |
31,443,662 | 2015-07-16T00:51:00.000 | -1 | 0 | 1 | 0 | python,macos,python-2.7 | 31,443,715 | 2 | false | 0 | 0 | When creating your virtual environment (you are using a virtual environment, right?) use pyvenv <foo> instead of virtualenv <foo>, and that will create a Python 3 virtual environment, free of Python 2. Then you are free to use pip and it will install the modules into that venv. | 2 | 0 | 0 | I'm fairly new to python and want to start doing some more advanced programming in python 3. I installed some modules using pip on the terminal (I'm using a mac) only to find out that the modules only installed for python 2. I think that it's because I only installed it to the python 2 path, which I think is because my... | Python Modules Only Installing For Python 2 | -0.099668 | 0 | 0 | 33 |
31,443,662 | 2015-07-16T00:51:00.000 | 0 | 0 | 1 | 0 | python,macos,python-2.7 | 31,443,681 | 2 | true | 0 | 0 | You need to use pip3. OS X will default to Python 2 otherwise. | 2 | 0 | 0 | I'm fairly new to python and want to start doing some more advanced programming in python 3. I installed some modules using pip on the terminal (I'm using a mac) only to find out that the modules only installed for python 2. I think that it's because I only installed it to the python 2 path, which I think is because my... | Python Modules Only Installing For Python 2 | 1.2 | 0 | 0 | 33 |
31,447,971 | 2015-07-16T07:30:00.000 | 0 | 1 | 0 | 1 | python,debian,remote-server,directory-structure | 31,448,678 | 1 | false | 0 | 0 | Basically you're stuffed.
Your problem is:
You have a script, which produces no error messages, no logging, and no other diagnostic information other than a single timestamp, on an output file.
Something has gone wrong.
In this case, you have no means of finding out what the issue was. I suggest any of the following... | 1 | 0 | 0 | I have written a python script that is designed to run forever. I load the script into a folder that I made on my remote server which is running debian wheezy 7.0. The code runs , but it will only run for 3 to 4 hours then it just stops, I do not have any log information on it stopping.I come back and check the running... | Where to run python file on Remote Debian Sever | 0 | 0 | 0 | 85 |
31,453,751 | 2015-07-16T12:08:00.000 | 1 | 1 | 1 | 0 | python,python-unittest | 31,455,230 | 2 | true | 0 | 0 | From the OP:
"This is called even if the test method raised an exception, so the implementation in subclasses may need to be particularly careful about checking internal state."
The first things this conveys is that you can be sure that teardown is called whatever happens in your test methods. Consequently this means t... | 1 | 1 | 0 | I am new to python. I read unittest docs. In the documentation about tearDown() method, I found following lines
"This is called even if the test method raised an exception, so the implementation in subclasses may need to be particularly careful about checking internal state."
What does this statement conveys ? Can you ... | teardown method in unittest python | 1.2 | 0 | 0 | 353 |
31,454,547 | 2015-07-16T12:44:00.000 | 1 | 0 | 1 | 0 | python,anaconda,spyder | 31,454,881 | 1 | false | 0 | 0 | An interpreter is simply an instance of the python executable being run by the operating system. When you call python interactively from a terminal or command prompt, you are calling the python interpreter to wait for user input and evaluate code line by line. Spyder provides a method to effectively have this same wind... | 1 | 1 | 0 | I am new to Python, coming from a MATLAB background. I am using the Anaconda / Spyder 2.2.5 IDE. I am having trouble understanding the terminology used for the development environment. There are "interpreters", "consoles", "kernels", and "shells". Are these all specific entities, or is "interpreter" used interchang... | python Spyder IDE terminology | 0.197375 | 0 | 0 | 281 |
31,456,035 | 2015-07-16T13:45:00.000 | 0 | 0 | 0 | 0 | python,django,forms | 31,518,565 | 1 | true | 1 | 0 | If anyone has the same problem here is the solution (to my problem at least):
I tried to use the clean_<fieldname> method to change the user entered string to database id. The method wasn't executing because the validation process was stopping earlier because of the difference between the form field and the widget. I r... | 1 | 1 | 0 | First of all I have tried to research my problem but have not been able to find what I need. My problem might be related to the design of my project (any help would be appreciated).
The problem I am facing is as follows:
I have a few models
I have a model that would be used specifically to create a ModelForm
In this m... | Django ForeignKey form field widget | 1.2 | 0 | 0 | 1,873 |
31,456,406 | 2015-07-16T14:00:00.000 | 0 | 0 | 0 | 0 | python-2.7,openerp,odoo | 31,456,810 | 1 | true | 1 | 0 | Yes you can, for every class new_class(... with a unique _name="new.class" is created a table in the data base, if you want more than one table, you need to create more than one class in your .py file
For more reference look the account module in account_invoice.py you have class account_invoice(models.Model): _name =... | 1 | 0 | 0 | Each module in odoo have a table in the database.
I'd like to know if I can create two tables in the odoo database for one module. | Is there any way to create two tables in the database for one odoo module? | 1.2 | 1 | 0 | 592 |
31,457,146 | 2015-07-16T14:30:00.000 | 1 | 0 | 0 | 0 | javascript,python,flask,jinja2 | 31,458,066 | 1 | true | 1 | 0 | That doesn't make sense!
Flask/Jinja can't read from javascript vars.
However, (as you said it is a POST request) you could:
Three ways:
Passing (dynamically modifying DOM link or form action URL) counter var value to POST request URL, like:
/path/postaction?counter=4;
If it's a POST request from form you could modif... | 1 | 0 | 0 | I am working on a little flask project and in my javascript script I have a variable which works as a counter.
When I receive a POST request I would like my python script to extract this counter variable.
I tried to set a jinja2 variable by doing {%set extractor_var = js_counter%} but it seems to be impossible to use... | Extract a javascript variable with flask | 1.2 | 0 | 0 | 257 |
31,459,477 | 2015-07-16T16:15:00.000 | 0 | 0 | 0 | 0 | python,postgresql,sqlalchemy | 34,866,070 | 1 | false | 0 | 0 | First off, I'd advise against doing 'from import *' that can bring unknown things into your namespace that are quite difficult to debug.
Second, the sqlalchemy module simply doesn't have a 'DOUBLE_PRECISION' column type. So the reason it says it's not defined, is because sqlalchemy does not define any such name. Perha... | 1 | 0 | 0 | I am running a migrate script in postgres, and at the top of one of the files I have from sqlalchemy import *
in the file I create tables with entries such as
1Column('tmp1', DOUBLE_PRECISION(precision=53))
However, when I run the script I get the error:
name 'DOUBLE_PRECISION' is not defined
Why is this? | name 'DOUBLE_PRECISION' is not defined - PostgreSQL - SQLAlchemy | 0 | 1 | 0 | 622 |
31,462,392 | 2015-07-16T18:59:00.000 | 2 | 1 | 1 | 0 | php,python,return | 31,463,247 | 1 | false | 0 | 0 | You can print your result in JSON format and the exec() function will return the string. This string can be used to retrieve your value using any JSON decoder. | 1 | 1 | 0 | I run a python script from a php script and i want to php take return value from python(return value is a list). I use exec() function for running python.
How can i do that? Thx | Take return value from python script from php | 0.379949 | 0 | 0 | 361 |
31,464,191 | 2015-07-16T20:44:00.000 | 0 | 0 | 0 | 0 | python,wxpython,right-click,wxwidgets,popupmenu | 31,477,578 | 1 | true | 0 | 1 | As far as I can tell, that is not supported. Besides, no user is going to expect that they need to right click on a context menu anyway. You should rethink your design so it's more intuitive. Perhaps by using a sub-menu instead of a secondary popup menu | 1 | 0 | 0 | I have a wx Popupmenu appear when I left-click on a toolbar LabelTool. I already have a binding to have a handler run when I left click an item in the menu, but I want another popup menu to appear when I right click an item in the original popup menu. I've already tried binding it to wx.EVT_RIGHT_DOWN but it doesn't do... | Have a popupmenu appear on a popupmenu on right-click | 1.2 | 0 | 0 | 67 |
31,464,223 | 2015-07-16T20:47:00.000 | 4 | 0 | 0 | 0 | python,amazon-web-services,boto | 31,464,224 | 1 | false | 0 | 0 | ICMP does not have ports in the protocol, unlike TCP. So when making the Boto call, use -1 for the source and destination ports to avoid the above error. AWS considers -1 to be All. Using 0 is also valid, however I haven't verified that it allows all traffic. It should, given that ICMP has no ports in the protocol. | 1 | 1 | 0 | When creating an AWS security group rule for ICMP using Boto, I received the following error. I was specifying the port range as 0 to 65535, which is the way to specify all ports for TCP.
ICMP code (65535) out of range (InvalidParameterValue)
How do I address this? | Python Boto: ICMP code (65535) out of range (InvalidParameterValue) | 0.664037 | 0 | 1 | 840 |
31,464,366 | 2015-07-16T20:56:00.000 | 0 | 0 | 0 | 1 | python,web | 66,746,290 | 4 | false | 0 | 0 | keep the files in a some folder which you want to access from a localhost
In command prompt go to that location and type
python -m http.server 8080
now type localhost :8080 in browser you will able to access files in that folder
if u want to use some js files for paticular html files then
<script src="http://localho... | 1 | 3 | 0 | I want to access files in my local machine by using urls. For example "file:///usr/local/home/thapaliya/constants.py". What would be the best way to achieve this? | Access local files from locally running http server | 0 | 0 | 0 | 3,484 |
31,466,493 | 2015-07-17T00:02:00.000 | 0 | 0 | 0 | 0 | java,http,post,httpclient,python-requests | 31,466,587 | 1 | false | 0 | 0 | If you try to PUT without any knowledge of the server this request will "fail" (or not - depends on the implementation e.g. it can redirect you to main page).
Failure is indicated by the server response code along with headers. E.g. 405 Method Not Allowed or 400 bad request etc. Or redirect you to main page: 302 Found... | 1 | 0 | 0 | Please bear with me as I have been reading and trying to understand HTTP and the different requests available in its protocol but there are still a few loose connections here and there.
Specifically, I have been using Apache's HttpClient to send requests, but I'm unsure of a few things. When we make a request to a URI,... | How to determine how to format an HTTP request to some server | 0 | 0 | 1 | 25 |
31,466,828 | 2015-07-17T00:48:00.000 | 0 | 1 | 0 | 0 | python,sentry | 31,466,945 | 2 | false | 1 | 0 | I found it - found even two different ways:
I can make projects public (under project settings) so everyone (with a sentry account) can access it.
I can give a users access to a project and that user has to opt-out of emails by going to his Account (top right) and then notifications. | 2 | 1 | 0 | Can I give a user access to a sentry project but not send him all the emails?
Sometimes I want to forward the error message to our mobile developers, so they can see the parameters, but they don't need to get all the other reports. | Sentry limit notifications to certain users | 0 | 0 | 0 | 162 |
31,466,828 | 2015-07-17T00:48:00.000 | 0 | 1 | 0 | 0 | python,sentry | 31,466,990 | 2 | false | 1 | 0 | The best way to deal with this is to make the organization "open membership". Members can then choose to join or leave teams, and opt-out of project-specific notifications when they want. | 2 | 1 | 0 | Can I give a user access to a sentry project but not send him all the emails?
Sometimes I want to forward the error message to our mobile developers, so they can see the parameters, but they don't need to get all the other reports. | Sentry limit notifications to certain users | 0 | 0 | 0 | 162 |
31,468,049 | 2015-07-17T03:41:00.000 | 1 | 0 | 1 | 0 | python,python-2.7,python-3.x,yield-keyword | 31,468,079 | 4 | false | 0 | 0 | print was a keyword defined by the language specification in Python 2, and became a builtin function (defined by the standard library specification) Python 3. yield was, and still is, a keyword. | 1 | 7 | 0 | In Python, I have many times seen the yield function used to create a generator. Both this and the print function technically both perform the action of methods because they return a value. However, during the change from Python 2 to Python 3, the print function gained parentheses like a normal method call, but yield s... | Why does the yield function not require parentheses in Python? | 0.049958 | 0 | 0 | 1,230 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.