Q_Id
int64
337
49.3M
CreationDate
stringlengths
23
23
Users Score
int64
-42
1.15k
Other
int64
0
1
Python Basics and Environment
int64
0
1
System Administration and DevOps
int64
0
1
Tags
stringlengths
6
105
A_Id
int64
518
72.5M
AnswerCount
int64
1
64
is_accepted
bool
2 classes
Web Development
int64
0
1
GUI and Desktop Applications
int64
0
1
Answer
stringlengths
6
11.6k
Available Count
int64
1
31
Q_Score
int64
0
6.79k
Data Science and Machine Learning
int64
0
1
Question
stringlengths
15
29k
Title
stringlengths
11
150
Score
float64
-1
1.2
Database and SQL
int64
0
1
Networking and APIs
int64
0
1
ViewCount
int64
8
6.81M
41,989,065
2017-02-01T20:24:00.000
1
0
1
0
python,regex
41,989,121
2
false
0
0
Wouldn't this get all groups of adjacent \r and \n characters regardless of order or amount? Edited per comments: [\r\n]+
1
1
0
Is there a way to match a line break independently of system? i.e. match both \n and \r\n. The only thing I can think of is \r?\n which just feels clunky. The reason I want to do this is if I need to match 2 in a row, \n\n no longer works and if I match \n, then the preceding \r will still exist and I would have to ...
python regex: match any style line break
0.099668
0
0
6,833
41,989,455
2017-02-01T20:47:00.000
1
1
0
1
aerospike,python-3.6
41,991,031
3
false
0
0
I figured it out. I just needed to use pip3 instead of pip to install it to correct version of python (though I was only able to get it onto 3.5, not 3.6 for some reason).
1
1
0
I just followed the instructions on the site and installed aerospike (on linux mint). I'm able to import the aerospike python client module from python 2.7 but not from 3.6 (newly installed). I'm thinking that I need to add the directory to my "python path" perhaps??, but having difficulty understanding how this work...
newbie installing aerospike client to both my python versions
0.066568
0
0
154
41,991,575
2017-02-01T23:13:00.000
0
0
0
1
python,vagrant,pycharm
41,991,612
1
true
0
0
Turns out I was only changing the project python interpreter configuration to point to my running Vagrant machine, however, the Run/Debug Configuration wasn't set to use this project interpreter, but rather a different Vagrant machine which was currently down. Fixed by editing the Run/Debug Configuration and changing t...
1
0
0
I get the following PyCharm error when running my python3 interpreter on Vagrant: Error running x.py Can't run remote python interpreter: The provider for this Vagrant-managed machine is reporting that it is not yet ready for SSH. Depending on your provider this can carry different meanings. Make sure your machine i...
Running python3 using a Run/Debug config with Vagrant: "Error running x.py Can't run remote python interpreter"
1.2
0
0
691
41,992,016
2017-02-01T23:51:00.000
1
0
0
0
python,facebook-live-api
42,508,346
1
true
0
0
No, there is no such API at this time.
1
0
0
Is there a Facebook API call to retrieve all or a subset of the current live videos with the relative metadata, such as location, user who is streaming, time at stream? The implementation could be in Python.
How to access videos in Facebook livemap programmatically?
1.2
0
1
355
41,992,104
2017-02-02T00:00:00.000
0
0
1
1
python,linux
41,992,148
2
false
0
0
1) You should not modify the system's binaries yourself directly 2) If your $PATH variable doesn't contain /usr/local/bin, the naming of that secondary directory isn't really important. You can install / upgrade independently wherever you have installed your extra binaries. 3) For Python specifically, you could also j...
1
7
0
On Linux, specifically Debian Jessie, should I use /usr/bin/python or should I install another copy in /usr/local/bin? I understand that the former is the system version and that it can change when the operating system is updated. This would mean that I can update the version in the latter independently of the OS. As I...
/usr/bin/python vs /usr/local/bin/python
0
0
0
6,843
41,993,499
2017-02-02T02:59:00.000
0
0
1
0
python,c++,sonarqube,sonarqube-scan
42,019,717
1
true
0
0
Yes, SonarC++ build-wrapper is generic and you can use it with distutils. Follow the documentation on sonarqube.com which provides examples on how to setup the analysis of C/C++ projects.
1
0
0
I have a python project with a significant amount of C/C++ code, and I use distutils to build the project. When using sonarqube, I received the following message: By using the build-wrapper-output.bypass=true property, you'll switch to an "at best" mode that could result in false-positives and false-negatives. (Note...
Sonarqube build wrapper for distutils
1.2
0
0
240
41,997,011
2017-02-02T08:04:00.000
1
0
1
0
python,anaconda
44,805,251
1
false
0
0
I had the exact same problem, and solved it using various answers from various places. Here is what I did: Open a terminal, then copy paste: conda update nb_conda nb_conda_kernels nb_anacondacloud For me it answered that nb_conda wasn't installed, so I added: conda install nb_conda From there, jupyter notebook laun...
1
0
0
I just downloaded and installed anaconda, and I opened the jupyther notebook from the "start" menu, it prompts a black window that looks like a command line window, but instead of opening my browser on the notebook "tree" page, it just closes the black command line window and nothing happens. I formatted my computer an...
Python Anaconda Jupyther notebook doesn't launch
0.197375
0
0
663
41,999,094
2017-02-02T09:58:00.000
2
0
1
0
python,pymongo
41,999,635
2
false
0
0
use dateutil dateutil.parser.parse("2017-10-13T10:53:53.000Z") will return datetime.datetime(2017, 10, 13, 10, 53, 53, tzinfo=tzutc())
1
25
0
How to insert datetime string like this "2017-10-13T10:53:53.000Z" into mongo db as ISODate? I get a string in mongodb when I insert: datetime.strptime("2017-10-13T10:53:53.000Z", "%Y-%m-%dT%H:%M:%S.000Z")
How to insert datetime string into Mongodb as ISODate using pymongo
0.197375
1
0
43,049
42,000,361
2017-02-02T10:56:00.000
0
1
0
0
python,firefox,selenium-webdriver
42,038,226
1
false
0
0
This depends to some degree on the browser you're using. If you are using a current version of Chrome or Firefox, deleting all cookies before starting testing won't make sense, as every driver instance will start with a separate, temporary profile without any cookies anyway. Deleting all cookies after running the tests...
1
0
0
I need to use delete_all_cookies in my code. I have some concerns: Do I need to place before opening the url or before quit Can anyone clarify the same? A lot of cache has been created during my test runs. My main objective is to clear cache in test server machine.
At which point should I place delete_all_cookies
0
0
0
33
42,001,300
2017-02-02T11:40:00.000
2
0
1
0
python,bokeh
42,007,553
1
true
0
0
You have more than one python or python environment installed on your system, and the python that you are actually running is different from the one that your have installed bokeh into. As a concrete example, here is one possible scenario, similar to ones I have seen on occasion: Jupyter notebook installed in the OS/...
1
2
0
I am trying to run some bokeh examples, and when I import bokeh.layouts (either from the ipython interpreter, or in a jupyter notebook) I get the following error: ImportError: No module named 'bokeh.layouts'. I am using python 3.5 and bokeh 0.12.4 installed via conda install bokeh. What's wrong with this?
ImportError: No module named 'bokeh.layouts'
1.2
0
0
6,112
42,003,456
2017-02-02T13:27:00.000
0
0
0
0
python,python-2.7,session,request,phantomjs
42,003,480
1
false
1
0
You don't need to keep sending the session, as long as you keep the Python application running you should be good.
1
1
0
So I am currently writing a script that will allow me to wait on a website that has queue page before I can access contents Essentially queue page is where they let people in randomly. In order to increase my chance of getting in faster , I am writing multi thread script and have each thread wait in line. First thing...
Does Python requests session keep page active?
0
0
1
194
42,003,461
2017-02-02T13:27:00.000
-2
0
0
0
python,e-commerce,bigcommerce
48,835,159
1
false
1
0
This will create the product on the BigCommerce website. You create the image after creating the product, by entering the following line. The image_file tag should be a fully qualified URL pointing to an image that is accessible to the BigCommerce website, being found either on another website or on your own webserver....
1
3
0
how do I upload an image (from the web) using Bigcommerce's Python API? I've got this so far: custom = api.Products.create(name='Test', type='physical', price=8.33, categories=[85], availability='available', weight=0) Thank you! I've tried almost everything!
Bigcommerce Python API, how do I create a product with an image?
-0.379949
0
1
438
42,006,246
2017-02-02T15:34:00.000
1
0
0
0
python,django,django-allauth
42,011,936
1
false
1
0
@pennersr was kind enough to answer this on the allauth github page: This truly all depends on how you model things, there is nothing in allauth that blocks you from implementing the above. One way of looking at things is that the signup form is not different at all. It merely contains an additional switch that in...
1
0
0
Having read many stack overflow questions, tutorials etc on all-auth I keep getting the impression that it only supports the registration of one type of user per project. I have two usecases A business user authenticates and registers his business in one step. A developer user authenticates and just fills in the name ...
Django All-Auth Role Based Signup
0.197375
0
0
376
42,006,353
2017-02-02T15:40:00.000
1
0
1
0
python,regex,python-2.7
42,006,491
1
true
0
0
^ is indicating the beginning of the string. So it is only searching for the first character being an open bracket. You can remove the ^
1
0
0
This may have been asked already but I can't seem to find any duplicates so I am going to ask myself and hope I don't get flagged. I am building a small parser using a state machine that switches into a sub-parser whenever a { is detected. I only want the very first occurrence of what my regex will match at the positi...
python 2.7 regex search at pos where '^' starts at pos
1.2
0
0
43
42,006,500
2017-02-02T15:47:00.000
2
0
0
0
python,python-sphinx
48,073,039
1
false
1
0
inorder to install specific version of sphinx .type in terminal : pip install sphinx==1.4.9
1
0
0
The search functionality in my Sphinx doc has stopped working after upgrading to version 1.5.1. I'm using the sphinx_rtd_theme. How do I downgrade Sphinx to 1.4.9?
Downgrade Sphinx from version 1.5.2. to version 1.4.9
0.379949
0
0
1,461
42,006,758
2017-02-02T15:57:00.000
4
0
0
0
python,web-scraping
42,006,894
1
false
1
0
Apparently your IP was banned by the website for suspicious activity. There are couple ways around that: talk to website owners. This is the most straightforward and nicest way change your IP, e.g. by connecting though a pool of public proxies or Tor. This is a little bit dirty and it is not so robust, e.g. you can be...
1
2
0
I made a simple scraper that accesses an album, and scrapes lyrics for each song from azlyrics.com. After about an hour of working, the website crashed, with an error: Chrome: www.azlyrics.com didn’t send any data. ERR_EMPTY_RESPONSE Tor, firefox, waterfox: The connection was reset The connection to the server was...
Website error after scraping
0.664037
0
1
337
42,006,791
2017-02-02T15:58:00.000
1
0
0
0
python,django,debugging
42,007,400
3
false
1
0
"Internal" is a relative term. People or machines on the internal network can still be considered attackers.
3
0
0
I'm working on a Django project that I took over for someone else that is only used internally. It's not deployed to a website and can only be accessed on a local network. The previous developer had left DEBUG = True in settings.py. Django docs really emphasize that leaving DEBUG=True when the site is in production ...
Leave Debug on in Django for internal application
0.066568
0
0
162
42,006,791
2017-02-02T15:58:00.000
3
0
0
0
python,django,debugging
42,006,881
3
false
1
0
Debug mode might leak a bit of memory. Additionally, it is much better for production systems, however small, to email their administrator with the full error message and stack trace (which Django does by default when DEBUG=False) than to show it on the browser. This way the administrator knows exactly what happened in...
3
0
0
I'm working on a Django project that I took over for someone else that is only used internally. It's not deployed to a website and can only be accessed on a local network. The previous developer had left DEBUG = True in settings.py. Django docs really emphasize that leaving DEBUG=True when the site is in production ...
Leave Debug on in Django for internal application
0.197375
0
0
162
42,006,791
2017-02-02T15:58:00.000
1
0
0
0
python,django,debugging
42,006,896
3
false
1
0
The Django docs warn to never deploy with debug on: Never deploy a site into production with DEBUG turned on. Did you catch that? NEVER deploy a site into production with DEBUG turned on. Later, they give a reason that isn't related to security: It is also important to remember that when running with DEBUG turned on...
3
0
0
I'm working on a Django project that I took over for someone else that is only used internally. It's not deployed to a website and can only be accessed on a local network. The previous developer had left DEBUG = True in settings.py. Django docs really emphasize that leaving DEBUG=True when the site is in production ...
Leave Debug on in Django for internal application
0.066568
0
0
162
42,007,071
2017-02-02T16:12:00.000
2
0
1
0
python,pip,global,packages,local
42,007,776
1
false
0
0
The stuff under /usr/lib is system packages considered part of the OS. It's likely/possible that OS scripts and services will have dependencies on these components. I'd recommend not touching these yourself, or really using or depending on them for user scripts either as this will make your app OS or even OS version de...
1
1
0
I'm confused about the possibilities of installing external python packages: install package local with pip into /home/chris/.local/lib/python3.4/site-packages $ pip install --user packagename install package global with pip into /usr/local/lib/python3.4/site-packages (superuser permission required) $ pip install pack...
When install external python packages global, when local? pip or system package-manager?
0.379949
0
0
795
42,007,272
2017-02-02T16:23:00.000
0
0
0
1
python,windows,python-3.x,winapi,pywin32
50,964,423
4
false
0
0
If you have the rotate shortcut active in windows (CTRL+ALT+ARROW KEY) you can use pyautogui.hotkey function.
1
1
0
I am trying to write a python script to rotate screen in Windows. I have clues of doing it with Win32api. What are the other possibilities or commands to achieve so(Win32api included).
Screen rotation in windows with python
0
0
0
4,207
42,007,591
2017-02-02T16:38:00.000
1
0
0
0
python,keras,object-detection,training-data
42,181,934
1
true
0
0
Your task is a so-called binary classification. Make sure, that your final layer has got only one neuron (e.g. for Sequential model model.add(Dense(1, ... other parameters ... ))) and use the binary_crossentropy as loss function. Hope this helps.
1
1
1
I want to make a system that recognizes a single object using keras. In my case I will be detecting car wheels. How do I train my system just for 1 object? I did classification task before using cats and dogs, but now its a completely different task. Do I still "classify", with class 0= wheels, class = 1 non wheels(jus...
Single object detection keras
1.2
0
0
907
42,008,704
2017-02-02T17:33:00.000
0
1
0
0
intellij-idea,pycharm,python-unittest
42,026,672
1
false
0
0
This turned out to be an issue I caused myself. we had added a folder called 'UnitTest' and introducing this to the path caused issues with PyCharm knowing what was a true UnitTest file. I still don't know exactly what caused some files to work, but there appears to be one method in those files that did work that was p...
1
0
0
I have upgraded my Community version of PyCharm to 2016.3.2, and I'm not positive it was this exact version, but when I went to run files that had unittests in them, only some of them are recognized as UnitTests that I can right click and run. I have looked to make sure that my classes implement unittest.TestCase class...
Did something Change with Pycharm 2016.3.2 - UnitTests no longer auto discovered
0
0
0
37
42,008,720
2017-02-02T17:34:00.000
0
0
0
0
python,database,sqlite,csv
42,173,826
2
true
0
0
So after researching some off the shelf options I found that the Devart Excel Add Ins did exactly what I needed. They are paid add ins, however, they seem to support almost all modern databases including SQlite. Once the add in is installed you can connect to a database and manipulate the data returned just like normal...
1
0
0
I was wondering if there is a way to allow a user to export a SQLite database as a .csv file, make some changes to it in a program like Excel, then upload that .csv file back to the table it came from using a record UPDATE method. Currently I have a client that needed an inventory and pricing management system for thei...
User friendly SQLite database csv file import update solution
1.2
1
0
572
42,009,558
2017-02-02T18:20:00.000
0
1
0
1
python,ubuntu
42,010,021
1
false
0
0
It was the path of the .py file being called inside jumpbox.py. I was referencing it only as the filename, without the full path, since it was in the same directory. os.system("python <full path>.py") made it work perfectly. Thanks @Hannu
1
0
0
I have a python program I want to run when a specific user logs into my Ubuntu Server. Previously, I tried to do this via the command useradd -m -s /var/jumpbox/jumpbox.py jumpbox. This ran the program, but it didn't work the same way it did when I call it via ./jumpbox.py from the /var/jumpbox directory. The problem i...
Ubuntu Server Run Script at Login for Specific User
0
0
0
65
42,013,132
2017-02-02T22:01:00.000
0
0
1
0
python,scipy,debian
42,013,274
3
false
0
0
You may want to try with pip3 install scipy
1
5
0
I used sudo apt-get install python-scipy to install scipy. This put all the files in /usr/lib/python2.7.dist-packages/scipy. My best guess is it chose that location because python 2.7 was the default version of python. I also want to use scipy with python 3 however. Does the package need to be rebuilt for python 3 or c...
Install scipy for both python 2 and python 3
0
0
0
27,416
42,013,705
2017-02-02T22:42:00.000
4
0
1
0
python,geany
44,169,039
3
false
0
0
Start by creating a project file that resides in your venv folder. Then, point to the Python interpreter that resides in the venv folder using the build configuration feature. These actions will allow you to run the correct Python interpreter for each virtual environment you create and not affect the configuration of ...
2
5
0
I am just starting to set up virtual environments for my Python projects. Up to now I have used and like Geany for development and testing. When I set up my new virtual environment, what will I need to set in Geany to make sure it runs my Python code in the appropriate venv? Thanks!
using geany with python virtual environment
0.26052
0
0
5,273
42,013,705
2017-02-02T22:42:00.000
1
0
1
0
python,geany
61,304,941
3
false
0
0
I am using Windows 10 and conda virtual environments, which I first have to activate before use. I was able to use these conda environments in Geany 1.36 by doing the following: Go to menu: Edit - Preferences, in there go to Tools tab and in Terminal, type the following: cmd.exe /Q/C conda activate envname && %c Repl...
2
5
0
I am just starting to set up virtual environments for my Python projects. Up to now I have used and like Geany for development and testing. When I set up my new virtual environment, what will I need to set in Geany to make sure it runs my Python code in the appropriate venv? Thanks!
using geany with python virtual environment
0.066568
0
0
5,273
42,015,758
2017-02-03T02:28:00.000
0
0
1
0
python,python-3.x,python-idle
42,015,874
3
false
0
0
You shouldn't have to worry about a limit. As for a new line, you can use an if with \n or a for loop depending on what you're going for.
2
0
0
I'm a bit curious as I want to create a file containing a dictionary that would automatically update whenever an event occurs and need to know if there is a limit to the number of characters Python's IDE can hold on a single line. An alternative for me would be at least knowing a way to make the dictionary always start...
Any limit to how many characters Python's IDE can take in one line?
0
0
0
1,765
42,015,758
2017-02-03T02:28:00.000
1
0
1
0
python,python-3.x,python-idle
42,016,708
3
true
0
0
As far as disk storage and ram memory are concerned, '\n is just another character. As far as tcl/tk and Python's tkinter wrapper are concerned, newlines are very important. Since tk's Text widget is intended to display text to humans, and since vertical scrolling is much more useful for this than horizontal scrollin...
2
0
0
I'm a bit curious as I want to create a file containing a dictionary that would automatically update whenever an event occurs and need to know if there is a limit to the number of characters Python's IDE can hold on a single line. An alternative for me would be at least knowing a way to make the dictionary always start...
Any limit to how many characters Python's IDE can take in one line?
1.2
0
0
1,765
42,017,180
2017-02-03T05:09:00.000
0
0
0
0
openerp,python-unicode,point-of-sale
44,111,743
1
false
1
0
Try this one maybe it could help you to solve the problem: Just try to make changes in default addons of your odoo. Because there are some configuration is there related to font printing. There is one module name hw_escpos in that module you can find one function where font configuration is there so just add font what ...
1
0
0
Any solutions for unsupported fonts to be able to print via POSBOX for odoo POS? POS BOX does not support Myanmar font. We need to print via POS BOX because we need multiple printings (to kitchen 1, to kitchen 2, to drink counter, etc ...). Any solutions for this issue, please?
Any solutions for unsupported fonts to be able to print via POSBOX for odoo POS?
0
0
0
542
42,018,636
2017-02-03T07:09:00.000
0
0
1
0
python,python-2.7,python-3.x,module,beautifulsoup
42,045,491
1
false
0
0
Look inside your pip3 script. Does the #!-line at the beginning actually contain python3.5? If not, change it.
1
0
0
I use both 2.7 and 3.5 and I want to keep both installed as we still use 2.7 in VFX and Gaming industry. The problem is when I attempt to install a module in 3.5 (for this example, I'll use "pip3 install beautifulsoup4"), the module installs in the 2.7 folder and not 3.5 folder. How do I get terminal to install the cor...
Installing Python modules in version 3.5.2 with both Python 2.7 and 3.5 already installed on Mac
0
0
0
963
42,019,279
2017-02-03T07:51:00.000
0
0
0
0
python,python-2.7,resume-upload
68,074,868
2
false
0
0
Excellent answer by GuySoft - it helped me a lot. I have had to slightly modify it as I never (so far) encountered the three exceptions his script is catching, but I experienced a lot of ConnectionResetError and socket.timeout errors on FTP uploads, so I added that. I also noticed that if I added a timeout of 60 secon...
1
3
0
I am trying to upload the file in python and i want to upload the file in resumable mode i.e when the internet connection resume , the file upload resume from the previous stage. Is there any specific protocol that supports resumable file upload. Thanks in advance
Resumable file upload in python
0
0
1
2,044
42,019,810
2017-02-03T08:27:00.000
1
0
0
0
python,sqlalchemy
42,028,145
1
false
1
0
If you're using a database session, you can simply specify the columns directly. session.query(User.email, User.name).filter(and_(User.id == id, User.status == 1)).first()
1
3
0
I'm using query like this: user = User.query.options(load_only("email", "name")).filter(and_(User.id == id, User.status == 1)).first() I want to get only email and name column as an User object. But it returns all columns. I can't find any solutions. Can anybody help? Thanks
SQLAlchemy ORM Load Cols Only not working
0.197375
1
0
1,278
42,023,939
2017-02-03T12:07:00.000
0
1
0
0
python,security,encryption,cryptography
42,026,136
2
false
1
0
Do the encryption and decryption on the second server (encryption server). Pass the password to the encryption server along with an id for encryption and it returns the encrypted password to store in the DB. When the password is needed pass the encrypted password to the encryption server for decryption. Have the encryp...
1
0
0
I'm currently building a website where the users would enter their credentials for another web service that I'm going to scrape to get their data. I want to make sure that when I save their credentials in my database, I'm using the best encryption possible and the best architecture to ensure the highest level of securi...
Encrypting credentials and reusing them securely
0
0
0
207
42,026,072
2017-02-03T14:04:00.000
-1
0
0
0
python,apache-spark,pyspark
42,027,081
1
false
0
0
include the package anyway to be sure eg via spak submit: $SPARK_HOME/bin/spark-shell --packages graphframes:graphframes:0.1.0-spark1.6
1
1
1
I have been at it for some time and tried everything. I need to find out whether the package GraphFrames is included in the spark installation at my office cluster. I am using Spark version 1.5.0. Is there a way to list all the installed packages in Spark?
Finding out installed packages in Spark
-0.197375
0
0
1,593
42,029,159
2017-02-03T16:51:00.000
0
0
0
0
python,algorithm,graph
42,029,561
1
false
0
0
Instead of using floating points for weights, use tuples (weight, number_of_edges) with pairwise addition. The lowest weight path using these new weights will have the lowest weight, and in the case of a tie, be the shortest path. To define these weights I would make them a subclass of tuple with __add__ redefined. T...
1
1
1
I am using a networkx weighted graph in order to model a transportation network. I am attempting to find the shortest path in terms of the sum of weighted edges. I have used Dijkstra path in order to find this path. My problem occurs when there is a tie in terms of weighted edges. When this occurs I would always like t...
Python: Shortest Weighted Path and Least Number of Edges
0
0
1
711
42,030,293
2017-02-03T17:59:00.000
0
0
0
0
python,django,heroku,garbage-collection,celery
42,077,350
1
false
1
0
Looks like the problem is that I'm not using .iterator() to iterate over the main queryset. Even though I'm freeing the data structures I'm creating after each iteration, the actual query results are all cached. Unfortunately, I can't use .iterator(), because I use prefetch_related extensively. I need some kind of hybr...
1
2
0
I have a background task running under Celery on Heroku, that is getting "Error R14 (Memory quota exceeded)" frequently and "Error R15 (Memory quota vastly exceeded)" occasionally. I am loading a lot of stuff from the database (via Django on Postgres), but it should be loading up a big object, processing it, then dispo...
Does Python garbage collect when Heroku warns about memory quota vastly exceeded (R15)?
0
0
0
609
42,033,360
2017-02-03T21:35:00.000
1
0
1
1
python,linux,chmod
42,035,060
2
true
0
0
Short answer is No. When you make chmod +x mypackage you are doing nothing because mypackage is a directory and directories already has execute flag (or you will be unable to list their files). If you type: ls -l you will see. Your options to run directly the whole package without installing it is the way you already ...
1
5
0
I want to make a python package executable from the command line. I know you can do chmod +x myfile.py where myfile.py starts with #!/usr/bin/env to make a single file executable using ./myfile.py. I also know you can do python -m mypackage to run a package including a __main__.py. However, if I add the shebang line ...
How to make a package executable from the command line?
1.2
0
0
4,192
42,033,430
2017-02-03T21:40:00.000
1
0
0
0
python,python-3.x,upload,nas,synology
42,033,609
1
true
0
0
The point of network drives is that they are used like local drives. So make it accessible to your operating system (mount on Unix/Linux/MacOS, share on Windows...) and copy the file to it. Alternatively, you can use a network protocol, such as webdav, sftp, whatever is enabled. python supports them all (sometimes with...
1
2
0
I want to make a file and upload that on a Synology NAS. I am using Python. It doesn't support FTP but it is just a network drive. I know the question is really short, I just don't know what more to tell.
How to upload file on Synology NAS?
1.2
0
1
1,321
42,035,082
2017-02-04T00:21:00.000
1
1
0
0
python,amazon-web-services,aws-lambda,amazon-kinesis-firehose
42,035,255
1
true
1
0
Preload the data into a Redis server. This is exactly what Redis is good at.
1
2
0
I have a python-based lambda function which triggers on s3 put operations based on a kinesis firehose stream which sends data at the rate of around 10k records per minute. Right now the lambda function just performs some small fixups of the data and delivers it to a logstash instance in batches of 100. The lambda execu...
Fast data access for AWS Lambda function
1.2
0
0
623
42,036,307
2017-02-04T03:58:00.000
1
1
0
0
python,node.js,web-applications,server
42,036,454
1
true
1
0
You don't need to create your own encrypted communication protocol. Just serve all traffic over https. If you also wish to encrypt the data before storing it on a database you can encrypt it on arrival to the server. Check out Express.js for the server, Passport.js for authentication and search for 256-bit encryption o...
1
1
0
I'm getting started out creating a website where users can store and get (on user request) private information they store on the server. Since the information is private, I would also like to provide 256 bit encryption. So, how should I go about it? Should I code the back end server stuff in node.js or Python, since I'...
Build a Server to Receive and Send User's Private Information
1.2
0
1
30
42,036,376
2017-02-04T04:10:00.000
1
0
0
0
python-2.7,flask,google-analytics
42,036,453
1
true
0
0
If you add your tracking code only on the one web page you wish to track, then you should be able to accomplish your goal. Just to clarify, if you have two web pages, trackme.html and donottrackme.html, you would place the Google Analytics tracking code only on trackme.html. IP, device information, user agent, etc. s...
1
0
0
I have requirement where I need to store users ip, device information, user_agent, etc. information for on url on my site. How do I go about this? This data will be used later as stats (which device hitting more, which locations etc.) I can see that Google analytics helps in tracking for entire site. How do I enable ...
Track users using Google analytics for one url on website
1.2
0
1
227
42,037,554
2017-02-04T07:03:00.000
1
0
0
0
python,selenium
42,040,656
1
false
0
0
Your problem is most likely the compatibility between Firefox and your GeckoDriver. Try using the latest Firefox and geckodriver. If you have a problem with Firefox, try reinstalling it and disable automatic updating.
1
0
0
I am new to windows and this is the first time I am running a Python program on windows. I am running a crawler program that uses selenium and firefox webdriver. My program runs successfully on mac/ubuntu, but on windows webdriver.Firefox() open a new geckodriver window(cmd like window) and just hangs there nothing af...
Windows: Selenium webdriver.Firefox hangs
0.197375
0
1
944
42,039,231
2017-02-04T10:24:00.000
0
0
1
1
python,powershell,exit
58,658,397
8
false
0
0
In my case, I found out that right ctrl + c does the trick in anaconda3 powershell - so no remapping necessary - I'm on Windows 10.
2
14
0
Python fails to quit when using Ctrl-C in Powershell/Command Prompt, and instead gives out a "KeyboardInterrupt" string. Recently I've reinstalled Windows 10. Before the reinstall Ctrl-C quit python (3.5/2.7) fine, with no output. Does anyone know why this has started happening? Whether it's just a simple setting? Th...
Ctrl-C for quitting Python in Powershell now not working
0
0
0
30,551
42,039,231
2017-02-04T10:24:00.000
0
0
1
1
python,powershell,exit
54,466,340
8
false
0
0
Hitting Esc button on the upper corner of the keyboard seems to work for me on Windows-7, inside Spyder with numpy running, for Python 3.+ It broke the infinite ...: on an erroneous syntax in the interactive script
2
14
0
Python fails to quit when using Ctrl-C in Powershell/Command Prompt, and instead gives out a "KeyboardInterrupt" string. Recently I've reinstalled Windows 10. Before the reinstall Ctrl-C quit python (3.5/2.7) fine, with no output. Does anyone know why this has started happening? Whether it's just a simple setting? Th...
Ctrl-C for quitting Python in Powershell now not working
0
0
0
30,551
42,039,868
2017-02-04T11:33:00.000
9
0
1
0
node.js,ipython,read-eval-print-loop,ijavascript
57,401,854
4
false
1
0
I've been looking for "ipython for node" for years and here's how I would answer your question: No.
1
31
0
Is there any kid of "repl + extra features" (like showing docs, module autoreload etc.), like iPython, but for Nodejs? And I mean something that runs locally & offline. This is a must. And preferably to work both in terminal mode and have an optional nicer GUI on top (like iPython + iPythonQT/Jupyter-qtconsole). The st...
Is there a REPL like iPython for Nodejs?
1
0
1
7,289
42,040,813
2017-02-04T13:15:00.000
-7
0
1
0
python,arrays,python-3.x,sorting
42,040,862
2
false
0
0
A list is a data structure that has characteristics which make it easy to do some things. An array is a very well understood standard data structure and isn't optimized for sorting. An array is basically a standard way of storing the product of sets of data. There hasn't ever been a notion of sorting it.
1
1
1
Why doesn’t the array class have a .sort()? I don't know how to sort an array directly. The class array.array is a packed list which looks like a C array. I want to use it because only numbers are needed in my case, but I need to be able to sort it. Is there some way to do that efficiently?
Why doesn’t 'array' have an in-place sort like list does?
-1
0
0
144
42,041,151
2017-02-04T13:50:00.000
1
0
0
0
python,numpy,fft,ifft
42,046,236
1
true
0
0
If you have amplitude and phase vectors for a spectrum, you can convert them to a complex (IQ or Re,Im) vector by multiplying the cosine and sine of each phase value by its associated amplitude value (for each FFT bin with a non-zero amplitude, or vector-wise).
1
0
1
How to compute irfft if I have only amplitude and phase spectrum of signal? In numpy docs I've found only irfft which use fourier coefficients for this transformation.
numpy irfft by amplitude and phase spectrum
1.2
0
0
411
42,043,418
2017-02-04T17:37:00.000
0
0
0
0
android,python,apache2,cgi
42,043,536
1
true
1
0
Hooray for worrying about security! Yes. There are always security holes. Use HTTPS rather than HTTP... Everywhere... (get free certificate from letsencrypt.com) Submitting data should generally use POST, not GET. (POST and HTTPS means the data is encrypted during transport. GET requests data via the URL which itself ...
1
0
0
1.Hi I have Python CGI script on Apache2 Server. 2.I want send data from apache2. Format is Json 3.Send data to mobile aplication. 4.Mobile aplication request data usefull HTTP Request Methods: GET. 5.The application uses HTTPURLCONECTION. But People ask, This is security hole. Is it realy security hole ?? Solution ...
Apache2 uses Python CGI script, it is Security hole?
1.2
0
0
102
42,044,315
2017-02-04T18:58:00.000
-1
0
0
0
python,selenium,webdriver,selenium-chromedriver,ui-automation
42,044,535
3
false
0
0
This should be as simple as not calling driver.quit() at the end of your test case. You should be left with the chrome window in an opened state.
1
3
0
I am trying to keep the chrome browser open after selenium finishes executing my test script. I want to re-use the same window for my second script to run.
How to keep chrome browser window open to be re-used after selenium script finishes on python
-0.066568
0
1
9,560
42,044,560
2017-02-04T19:19:00.000
0
1
0
1
shell,python-3.x,ftp,ibm-midrange
42,054,160
3
false
0
0
The CL command RUNRMTCMD can be used to invoke a command on a PC running a rexec() client. iSeries Access for Windows offers such a client, and there are others available. With the iSeries client, the output of the PC command is placed in a spool file on the AS/400, which should contain the results of the FTP session...
1
0
0
I am looking for an approach / design through which i want to automate the process of FTP from windows location to IFS location present on AS400 environment when ever there is a new file added to windows path. Below is the approach I thought, Please refine it if needed. We have an option WRKJOBSCDEthrough which we ca...
FTP Jar file from share path on windows to IFS location in AS400?
0
0
0
500
42,045,382
2017-02-04T20:43:00.000
1
0
1
0
python,pip,virtualenv
42,045,556
2
false
0
0
In my experience the best way to manage Python projects across multiple computers is NOT to try to distribute pip packages or virtualenv installations along with your program because that can lead to all sorts of problems. In fact, I'm not even sure that what you're trying to do is possible. Instead I would recommend t...
1
0
0
I'm a bit confused with what is happening, but I may be just misunderstanding how virtualenv is meant to work. First, I discovered I was getting errors because the path to my git folder had spaces in it. After removing spaces from the path, I created a fresh virtualenv, and then when activated pip list started working ...
Understanding pip, virtualenv and packages
0.099668
0
0
143
42,046,184
2017-02-04T22:07:00.000
3
0
0
0
python,numpy,logarithm
42,046,234
3
false
0
0
You can use ** for exponentiation: np.log(x/y) ** 2
1
0
1
I am trying to define ln2(x/y) in Python, within NumPy. I can define ln(x) as np.log(x) but how I can define ln2(x/y)? ln2(x/y); natural logarithm to the power of 2
Define logarithmic power for NumPy
0.197375
0
0
235
42,046,527
2017-02-04T22:48:00.000
1
0
1
0
python,nested,nested-lists
42,046,548
2
false
0
0
If you want to insert all values in b into a specifix index in a: Just do : a[1] = b
1
0
0
Python: Learning the basics here but I have 2 list and am trying to REPLACE the values of b into a specific index of a. I've tried doing a.insert(1, b), but that shifts the values to the side to insert the list.
Trying to replace a value within a list (via index) with another list in one line of code?
0.099668
0
0
81
42,048,725
2017-02-05T05:01:00.000
1
0
0
0
python,r,nlp,preprocessor,text-classification
42,048,793
2
false
0
0
Manual annotation is a good option since you have a very good idea of an ideal document corresponding to your label. However, with the large dataset size, I would recommend that you fit an LDA to the documents and look at the topics generated, this will give you a good idea of labels that you can use for text classific...
2
0
1
I have a data set of 1M+ observations of customer interactions with a call center. The text is free text written by the representative taking the call. The text is not well formatted nor is it close to being grammatically correct (a lot of short hand). None of the free text has a label on the data as I do not know what...
Text Classification - Label Pre Process
0.099668
0
0
501
42,048,725
2017-02-05T05:01:00.000
1
0
0
0
python,r,nlp,preprocessor,text-classification
42,063,332
2
true
0
0
Text Pre-Processing: Convert all text to lower case, tokenize into unigrams, remove all stop words, use stemmer to normalize a token to it's base word. There are 2 approaches I can think of for classifying the documents a.k.a. the free text you spoke about. Each free text is a document: 1) Supervised classification Ta...
2
0
1
I have a data set of 1M+ observations of customer interactions with a call center. The text is free text written by the representative taking the call. The text is not well formatted nor is it close to being grammatically correct (a lot of short hand). None of the free text has a label on the data as I do not know what...
Text Classification - Label Pre Process
1.2
0
0
501
42,050,671
2017-02-05T09:55:00.000
8
0
1
0
python,python-2.7
42,050,682
1
true
0
0
str.join() joins the elements of the iterable in the order of iteration, so it depends on the thing you are joining. A list object is an ordered sequence, so yes, the order is preserved.
1
1
0
I want to convert a list into a string using join(). I have to keep the order of the list elements in the string. Can I be sure that Python never changes the order during conversion? I use Python 2.7.x
Does Python '.join' keeps the input data order?
1.2
0
0
135
42,053,240
2017-02-05T14:31:00.000
0
0
1
0
python-3.x,crash,python-idle
42,232,624
1
true
0
0
In the end, I just retyped my code. Luckily, I'd done a backup the previous night, so didn't lose too much. I am now making sure to do daily backups.
1
1
0
I was writing my code, then I pressed Ctrl+S. It then started not responding. I closed it and came back on to find the file was now empty! Anyone know how I can retrieve it?
Python IDLE crashed when saving and all my code disappeared
1.2
0
0
431
42,053,855
2017-02-05T15:35:00.000
0
0
0
1
python,django
42,053,909
1
true
1
0
Well, you simply need to find a way for the two of them to communicate without opening huge security holes. My suggestion would be a message queue (rabbit MQ, amazon SQS). The aws application writes jobs to the message queue and a local script runs the worker which is waiting for messages to be written to the queue ...
1
0
0
I have a requirement to run a local python script which takes arguements and will run on local windows computer from python code hosted on aws.
How to run a local python script from django project hosted on aws?
1.2
0
0
59
42,057,667
2017-02-05T21:42:00.000
1
0
0
0
python,tensorflow
42,057,766
1
false
0
0
Not sure exactly what you are asking. I will answer about what I understood. In case you want to predict only one class for example digit 5 and rest of the digits. Then first you need to label your vectors in such a way that maybe label all those vectors as 'one' which has ground truth 5 and 'zero' to those vectors who...
1
1
1
I want to find the accuracy of one class in MMNIST dataset .So how can i split it on the basis of classes?
How can we use MNIST dataset one class as an input using tensorflow?
0.197375
0
0
567
42,058,677
2017-02-05T23:51:00.000
0
0
1
0
python,pip,virtualenv
42,059,013
2
false
0
0
You can use the history command to view the history of all your commands and then grep for pip with out put to a file. Similar to the comment above.
1
1
0
I'd like to keep a record of all pip commands that were executed in a given virtual environment and of the package versions that got installed/updated/removed. Is there an easy way to do that? Alternatively, how do I get requirements.txt (including --install-option, etc.) out of my virtual environment state, if that's ...
log all pip commands in a given virtual environment?
0
0
0
337
42,059,103
2017-02-06T01:03:00.000
0
0
0
0
python,tensorflow,one-hot-encoding
59,105,698
1
false
0
0
while preparing the data you can use numpy to set all the data points in class 5 as 1 and the others will be set to as 0 using . arr = np.where(arr!=5,arr,0) arr = np.where(arr=5,arr,1) and then you can create a binary classifier using Tensorflow to classifiy them while using a binary_crossentropy loss to optimize the...
1
2
1
In case you want to predict only one class. Then first you need to label your vectors in such a way that maybe label all those vectors as 'one' which has ground truth 5 and 'zero' to those vectors whose ground truth is not 5. how can I implement this in tensorflow using puthon
how to predict only one class in tensorflow
0
0
0
164
42,059,381
2017-02-06T01:53:00.000
5
0
0
0
python,django
42,257,514
1
true
1
0
I've worked on this since I posted it, and the real answer is what I've synthesized from multiple sources (including other stack exchange posts). So... Everything changed in Django before I started using it. After 1.7, the 'migrations' bit was internalized and posts including the word "South" are about how the world w...
1
1
0
So... I've done a lot of research on this... there are answers, but not complete or appropriate answers. I have an in-use and in-production django "project" in which the "main" application is called "pages" ... for reasonably dumb reasons. My problem is now to add mezzanine ... which has a sub-module mezzanine.pages ...
Django Migrate Change of App Name (active project)
1.2
0
0
1,272
42,060,186
2017-02-06T04:08:00.000
2
0
1
0
python,gspread
42,066,652
1
true
0
0
You can access a spreadsheet key with mySpreadSheet.id after you have opened it by title.
1
2
0
how do I get the key of the workbook if I know only the name of the workbook? I can use open by title, but once i'm in I didn't find a get.key type method in the documents. Is there a way to get the key by only knowing the title?
gspread get key once opened by title
1.2
0
0
140
42,061,730
2017-02-06T06:39:00.000
1
0
0
0
python,statistics
42,061,940
1
true
0
0
In any given data set, labeling variables as dependent or independent is arbitrary -- there is no fundamental reason that one column should be independent and another should be dependent. That said, typically it's conventional to say that "causes" are independent variables and "effects" are dependent variables. But thi...
1
0
1
I am a little bit confused in the classification of dependent and independent variables in my dataset, on which I need to make a model for prediction. Any insights or how-to's would be very helpful here. Suppose my dataset have 40 variables. In this case, it would be very difficult to classify the variables as independ...
Statistics: How to identify dependent and independent variables in my dataset?
1.2
0
0
2,782
42,070,138
2017-02-06T14:28:00.000
0
0
0
0
python,regex,database,chess
42,104,038
1
false
0
0
@Ev.Kounis solution is simple and effective, I've used it myself successfully. Most of the time, we only care the top chess players. That's what I did: Created a simple function like @Ev.Jounis suggests I also scanned the player rating. For example, there were several "Carlsen" players in my database, but they wouldn'...
1
1
1
I am studying a chess database with more than one million games. I am interested in identifying some characteristics of different players. The problem I have is that each single player appears with several identifications. For example, "Carlsen, M.", "Carlsen, Ma", "Carlsen, Magnus" and "Magnus Carlsen" all correspon...
Combining different names in a database
0
0
0
78
42,072,399
2017-02-06T16:16:00.000
0
0
1
0
python,python-docx
42,074,715
1
true
0
0
There is no "centralized authority" in a Word document of what Fonts have been used. You'll need to parse through the full document and detect them yourself. Runs are the right place to look, but you'll also need to check styles, both paragraph and character styles. Also, to be thorough, you'll need to check the docume...
1
0
0
I am using Python docx 0.8.5 I can't seem to be able to figure out how to get a list of typeface and sizes used in a document There is a Font object, accessible on Run.font but I can't handle this problem. Can somebody please point me to an example? Thanks
get a list of typeface and sizes used in a docx
1.2
0
0
51
42,074,639
2017-02-06T18:22:00.000
1
0
1
0
python,indexing
42,074,741
3
false
0
0
The best way to solve this problem is to use a dictioary instead of a list. A dictionary is defined as a pair of key:value and you can run a simple line of code to return the corresponding key of avalue in the dictionary
1
2
0
I have a list of lists that looks like this: [['A', 35], ['B', 74], ['C', 21], ['D', 2]] I want to find the first part of the list based on the second part. For example, I know I want to get 'C' just by using 21. I know the second part (21) and want to use it to get the first part ('C'). What's the best way to do this?
finding the associated value in a list of lists
0.066568
0
0
45
42,078,221
2017-02-06T22:13:00.000
2
0
1
0
python,numpy,scipy
42,078,393
2
true
0
0
As documentation say, when you use random.seed you have two options: random.seed() - seeds from current time or from an operating system specific randomness source if available random.seed(a) - hash(a) is used instead as seed Using time as seed is better practice if you want to have different numbers between two instan...
1
0
0
I am using irand=randrange(0,10) to generate random numbers in a program. This random number generator is used multiple times in the code. At the beginning of the code, I initiate the seed with random.seed(1234). Is this the right practice?
Seeding Python's random number generator
1.2
0
0
1,312
42,079,675
2017-02-07T00:23:00.000
0
0
1
0
python-2.7
42,079,696
1
false
0
0
The .pyc files are not readable by humans - the python interpreter compiles the source code to these files, and they are used by the python virtual machine. You can delete these files, and when you run the .py file again, you will see a new .pyc file created.
1
0
0
I was recently trying to make my own module when I realised a copy of my module had been made but instead of ending in .py like the origional, it ended in .pyc. When I opened it, I could not understand a thing. I was using the import to make a game from pygame and the fact that the .pyc file had a bunch of question mar...
are there limitations on .pyc files?
0
0
0
66
42,079,848
2017-02-07T00:44:00.000
0
0
0
0
python,web-scraping,session-cookies,vpn
42,079,994
1
false
1
0
HTTP 400 is returned, if the request is malformed. You should inspect the request being made, when you get the error. Perhaps, it is not properly encoded. VPN should not cause an HTTP 400.
1
1
0
I am scraping data from peoplefinders.com a website which is not accesible from my home country so I am basically using a vpn client. I login to this website with a session post and through the same session I get items from different pages of the same website. The problem is that I do scraping in a for loop with get r...
Does using a vpn interrupts python sessions requests which are using the same cookies over and over?
0
0
1
397
42,080,598
2017-02-07T02:19:00.000
0
0
0
0
java,python,rest,machine-learning,scikit-learn
69,476,803
6
false
1
0
I have been experimenting with this same task and would like to add another option, not using a REST API: The format of the Apache Spark models is compatible in both the Python and Jave implementations of the framework. So, you could train and build your model in Python (using PySpark), export, and import on the Java s...
3
5
1
I have been working on designing REST api using springframework and deploying them on web servers like Tomcat. I have also worked on building Machine Learning model and use the model to make prediction using sklearn in Python. Now I have a use case where in I want to expose a REST api which builds Machine Learning Mode...
What is the best way to build and expose a Machine Learning model REST api?
0
0
0
5,677
42,080,598
2017-02-07T02:19:00.000
0
0
0
0
java,python,rest,machine-learning,scikit-learn
46,918,647
6
false
1
0
I'm using Node.js as my rest service and I just call out to the system to interact with my python that holds the stored model. You could always do that if you are more comfortable writing your services in JAVA, just make a call to Runtime exec or use ProcessBuilder to call the python script and get the reply back.
3
5
1
I have been working on designing REST api using springframework and deploying them on web servers like Tomcat. I have also worked on building Machine Learning model and use the model to make prediction using sklearn in Python. Now I have a use case where in I want to expose a REST api which builds Machine Learning Mode...
What is the best way to build and expose a Machine Learning model REST api?
0
0
0
5,677
42,080,598
2017-02-07T02:19:00.000
0
0
0
0
java,python,rest,machine-learning,scikit-learn
42,127,532
6
false
1
0
Well it depends the situation you use python for ML. For classification models like randomforest,use your train dataset to built tree structures and export as nested dict.Whatever the language you uesd,transform the model object to a kind of data structure then you can ues it anywhere. BUT if your situation is a large ...
3
5
1
I have been working on designing REST api using springframework and deploying them on web servers like Tomcat. I have also worked on building Machine Learning model and use the model to make prediction using sklearn in Python. Now I have a use case where in I want to expose a REST api which builds Machine Learning Mode...
What is the best way to build and expose a Machine Learning model REST api?
0
0
0
5,677
42,080,763
2017-02-07T02:39:00.000
1
0
0
0
python,tkinter
42,080,815
1
false
0
1
No, you cannot rotate text on a canvas. From the canonical documentation: Individual items may be moved or scaled using widget commands described below, but they may not be rotated.
1
0
0
In Tkinter, I need to be able to move text in a certain degrees, not to a new x and y coordinate. is there any way I could do this? Any help is greatly appreciated!
Tkinter c.move text with degrees?
0.197375
0
0
116
42,081,202
2017-02-07T03:27:00.000
0
0
1
0
python,azure,azure-blob-storage,azure-machine-learning-studio
42,081,531
2
false
0
0
yes, you should be able to do that using Python. At the very least, straight REST calls should work.
1
0
1
Is it possible to import images from your Azure storage account from within a Python script module as opposed to using the Import Images module that Azure ML Studio provides. Ideally I would like to use cv2.imread(). I only want to read in grayscale data but the Import Images module reads in RGB. Can I use the BlockBl...
Importing images Azure Machine Learning Studio
0
0
0
775
42,081,790
2017-02-07T04:33:00.000
2
0
0
0
python,pandas,dataframe
42,081,957
1
true
0
0
altering @VaishaliGarg's answer a little, you can use df.groupby(['Qgender','Qmajor']).count() Also if needed a dataframe out of it, we need to add .reset_index() since it would be a groupbyObject. df.groupby(['Qgender','Qmajor']).count().reset_index()
1
1
1
Sorry about the vague title, but I didn't know how to word it. So I have a pandas dataframe with 3 columns and any amount of rows. The first column is a person's name, the second column is their major (six possible majors, always written the same), and the third column is their gender (always 'Male' or 'Female'). I w...
Pandas dataframe: Listing amount of people per gender in each major
1.2
0
0
5,858
42,086,214
2017-02-07T09:32:00.000
1
0
0
0
python,tensorflow,pycharm
44,600,199
1
false
0
0
I have run into a similar error running caffe on pycharm. I think it's because of the version of Python. When I installed Python 2.7.13, it worked!
1
1
1
When I ran a script in PyCharm, it exited with: I tensorflow/stream_executor/dso_loader.cc:128] successfully opened CUDA library libcublas.so locally I tensorflow/stream_executor/dso_loader.cc:128] successfully opened CUDA library libcudnn.so locally I tensorflow/stream_executor/dso_loader.cc:128] successfully opened...
pycharm cannot run script but can debug it
0.197375
0
0
1,056
42,087,789
2017-02-07T10:46:00.000
1
0
1
0
python,spyder
42,121,732
2
false
0
0
(Spyder developer here) We're aware of these problems in the Python console, but unfortunately we don't know how to fix them. Please use the IPython console instead because the Python console is going to be removed in Spyder 3.2.
1
0
0
I am currently using Spyder and have been for a long time, however I downloaded anaconda recently and started using Spyder for Python 3.5 which gives me several problems. Whenever I run a script in the Python Console, I have to run it twice and then when I am finished running it and want to run a new I have to kill the...
Spyder IDE environment in Python
0.099668
0
0
502
42,089,045
2017-02-07T11:44:00.000
-1
0
1
0
python,pymongo
63,628,554
2
false
0
0
Try removing all white space in the files (\n, spaces outside string quotes). It may work like miracle
1
5
0
I want to insert document to the collection from json file it says bson.errors.InvalidDocument: key '$oid' must not start with '$' How can I solve it? example of document: [{"name": "Company", "_id": {"$oid": "1234as123541gsdg"}, "info": {"email": "test@gmail.com"}}]
bson.errors.InvalidDocument: key '$oid' must not start with '$' trying to insert document with pymongo
-0.099668
1
0
9,580
42,089,856
2017-02-07T12:23:00.000
2
0
1
0
python,caching
42,091,305
3
true
0
0
There is no magic possible there - ou want to store a value, so you need a place to store your value. You can't just decide "I won't have an extra entry on my __slots__ because it is not elegant" - you don't need to call it _cached: give it whatever name you want, but these cached values are something you want to exis...
2
2
0
I am trying to cache a computationally expensive property in a class defined with the __slots__ attribute. Any idea, how to store the cache for later use? Of course the usual way to store a dictionary in instance._cache would not work without __dict__ being defined. For several reasons i do not want to add a '_cache' s...
Python caching attributes in object with __slots__
1.2
0
0
992
42,089,856
2017-02-07T12:23:00.000
-2
0
1
0
python,caching
42,089,927
3
false
0
0
Something like Borg pattern can help. You can alterate the status of your instance in the __init__ or __new__ methods.
2
2
0
I am trying to cache a computationally expensive property in a class defined with the __slots__ attribute. Any idea, how to store the cache for later use? Of course the usual way to store a dictionary in instance._cache would not work without __dict__ being defined. For several reasons i do not want to add a '_cache' s...
Python caching attributes in object with __slots__
-0.132549
0
0
992
42,089,967
2017-02-07T12:30:00.000
1
0
0
0
python,django
42,090,129
2
true
1
0
If you are using Django Rest Framework, then you can simply use serializers. But I don't think that is a case. What you want to accomplish seems very similar to the role of django forms, but as such they are only used (conventionally) for saving/updating models i.e. POST requests. Now either you can define a new class ...
1
2
0
My django app displays the objects from database in table view. The problem is that these objects (models) are pretty complex: the have 50+ fields. Nearly for each field I have to do some formatting: conver phone numbers from int 71234567689 to "+7 (123) 456789" display long prices with spaces: "7 000 000" instead of ...
Django: best way to convert data from model to view
1.2
0
0
392
42,092,448
2017-02-07T14:32:00.000
6
0
0
0
python,machine-learning,scikit-learn,knn
42,093,881
3
false
0
0
That's a pretty good question, and is unexpected at first glance because usually a normalization will help a KNN classifier do better. Generally, good KNN performance usually requires preprocessing of data to make all variables similarly scaled and centered. Otherwise KNN will be often be inappropriately dominated by...
2
7
1
I had trained my model on KNN classification algorithm , and I was getting around 97% accuracy. However,I later noticed that I had missed out to normalise my data and I normalised my data and retrained my model, now I am getting an accuracy of only 87%. What could be the reason? And should I stick to using data that is...
Accuracy difference on normalization in KNN
1
0
0
8,817
42,092,448
2017-02-07T14:32:00.000
2
0
0
0
python,machine-learning,scikit-learn,knn
42,093,691
3
false
0
0
If you use normalized feature vectors, the distances between your data points are likely to be different than when you used unnormalized features, particularly when the range of the features are different. Since kNN typically uses euclidian distance to find k nearest points from any given point, using normalized featur...
2
7
1
I had trained my model on KNN classification algorithm , and I was getting around 97% accuracy. However,I later noticed that I had missed out to normalise my data and I normalised my data and retrained my model, now I am getting an accuracy of only 87%. What could be the reason? And should I stick to using data that is...
Accuracy difference on normalization in KNN
0.132549
0
0
8,817
42,096,280
2017-02-07T17:31:00.000
11
0
1
0
python,python-3.x,anaconda
53,784,519
3
false
0
0
Anaconda is a Python-based data processing and scientific computing platform. It has built in many very useful third-party libraries. Installing Anaconda is equivalent to automatically installing Python and some commonly used libraries such as Numpy, Pandas, Scrip, and Matplotlib, so it makes the installation so much e...
1
129
0
I am a beginner and I want to learn computer programming. So, for now, I have started learning Python by myself with some knowledge about programming in C and Fortran. Now, I have installed Python version 3.6.0 and I have struggled finding a suitable text for learning Python in this version. Even the online lecture ser...
How is Anaconda related to Python?
1
0
0
112,856
42,096,970
2017-02-07T18:11:00.000
0
0
0
0
python,postgresql,uuid
51,623,094
2
false
0
0
The database is throwing an error because you're trying to match in a UUID-type column with a query that doesn't contain a valid UUID. This doesn't happen with integer or string queries because leaving off the last character of those does result in a valid integer or string, just not the one you probably intended. You...
1
0
0
I'm building a platform with a PostgreSQL database (first time) but I've experience with Oracle and MySQL databases for a few years now. My question is about the UUID data type in Postgres. I am using an UUIDv4 uuid to indentify a record in multiple tables, so the request to /users/2df2ab0c-bf4c-4eb5-9119-c37aa6c6b172 ...
PostgreSQL UUID date type
0
1
0
1,782
42,097,052
2017-02-07T18:16:00.000
18
0
1
0
python,string,f-string
42,097,136
8
true
0
0
Unfortunatly if you want to use it you must require Python 3.6+, same with the matrix multiplication operator @ and Python 3.5+ or yield from (Python 3.4+ I think) These made changes to how the code is interpreted and thus throw SyntaxErrors when imported in older versions. That means you need to put them somewhere whe...
2
57
0
The new Python 3.6 f-strings seem like a huge jump in string usability to me, and I would love to jump in and adopt them whole heartedly on new projects which might be running on older interpreters. 2.7, 3.3-3.5 support would be great but at the very least I would like to use these in Python 3.5 code bases. How can I i...
Can I import Python's 3.6's formatted string literals (f-strings) into older 3.x, 2.x Python?
1.2
0
0
30,101
42,097,052
2017-02-07T18:16:00.000
0
0
1
0
python,string,f-string
59,328,337
8
false
0
0
Using dict() to hold name-value pairs In addition to the approaches mentioned elsewhere in this thread (such as format(**locals()) ) the developer can create one or more python dictionaries to hold name-value pairs. This is an obvious approach to any experienced python developer, but few discussions enumerate this opt...
2
57
0
The new Python 3.6 f-strings seem like a huge jump in string usability to me, and I would love to jump in and adopt them whole heartedly on new projects which might be running on older interpreters. 2.7, 3.3-3.5 support would be great but at the very least I would like to use these in Python 3.5 code bases. How can I i...
Can I import Python's 3.6's formatted string literals (f-strings) into older 3.x, 2.x Python?
0
0
0
30,101
42,097,562
2017-02-07T18:45:00.000
3
0
0
0
python,amazon-web-services,amazon-dynamodb,aws-lambda,race-condition
42,102,617
1
true
1
0
Instead of deleting the hostname from DynamoDB, why not lock the hostname in DynamoDB?. If each item in DynamoDB corresponds to a unique hostname, then you can use a conditional write like the following and only try to acquire a hostname if it is not already acquired. You condition on the instanceid attribute Unused h...
1
0
0
Workflow : I have a python AWS lambda function that basically looks up a pool of hostnames in dynamo DB (json) and attaches one of them to an instance(that spins up) and then deletes that hostname from dynamo db so as not be used again for another instance. Problem : As soon as instance spins up it sends a notification...
Race condition with AWS Lambda
1.2
0
0
3,045
42,097,944
2017-02-07T19:07:00.000
0
0
1
0
java,python,timestamp
42,098,334
2
false
1
0
Note the differences: time.time() returns the time in seconds since the epoch as a floating point number, according to the timezone defined. System.currentTimeMillis() returns the time in milliseconds since the epoch as a long number, in UTC timezone. So to compare the two you need to: Convert the python time to UTC,...
1
2
0
I am working on multiple projects in python and java. I have a timestamp from python project as time.time(). I need to compare it with current timestamp in my java project as System.Currenttimemillis(). How to compare time in time.time() and System.Currenttimemillis()?
compare time.time() & System.Currenttimemillis()
0
0
0
1,633
42,101,552
2017-02-07T22:54:00.000
0
0
0
1
python-3.x,networking,nginx,docker
42,114,253
2
false
1
0
It's not a good thing to put a lot of applications into one container, normally you should split that with one container per app, it's the way it should be used. But if you absolutly want to use many apps into one container you can use proxy or write a dockerfile that will open your ports itself.
1
0
0
I am trying to put an application that listens to several ports inside a Docker image. At the moment, I have one docker image with a Nginx server with the front-end and a Python app: the Nginx runs on the port 27019 and the app runs on 5984. The index.html file listens to localhost:5984 but it seems like it only listen...
How to access several ports of a Docker container inside the same container?
0
0
0
42
42,103,374
2017-02-08T01:58:00.000
1
1
0
1
python,python-2.7,salt,salt-stack,salt-cloud
42,263,855
1
false
0
0
The salt packages are built using the system python and system site-packages directory. If something doesn't work right, file a bug with salt. You should avoid overwriting the stock python, as that will result in a broken system in many ways.
1
1
0
I am trying to setup a salt-master/salt-cloud on Centos 7. The issue that I am having is that I need Python 2.7.13 to use salt-cloud to clone vm in vmware vcenter (uses pyvmomi). CentOS comes with Python 2.7.5 which salt has a known issue with (SSL doesn't work). I have tried to find a configuration file on the machine...
How to change Default Python for Salt in CentOS 7?
0.197375
0
0
1,084
42,104,540
2017-02-08T04:10:00.000
35
0
1
0
python,regex,python-3.x,replace,capturing-group
42,104,650
4
true
0
0
Because it's supposed to replace the whole occurrence of the pattern: Return the string obtained by replacing the leftmost non-overlapping occurrences of the pattern in string by the replacement repl. If it were to replace only some subgroup, then complex regexes with several groups wouldn't work. There are several p...
1
27
0
re.sub('a(b)','d','abc') yields dc, not adc. Why does re.sub replace the entire capturing group, instead of just capturing group'(b)'?
Why does re.sub replace the entire pattern, not just a capturing group within it?
1.2
0
0
26,730
42,105,716
2017-02-08T05:55:00.000
0
0
0
0
python-3.x,pandas,matplotlib,pyspark,apache-spark-sql
42,110,000
1
false
0
0
Check out the hortonworks sandbox. It's a virtual machine with hadoop and all its components - such as spark ad hdfs - installed and configured. In a addition to that, there is a note book called Zeppelin notebook allowing you to write script in python or other languages. You're also free to install python libs and ac...
1
0
1
I want to know the which interpreter is good for Python to use features like Numpy, pandas and matplotlib with the feature of integrated Ipython note book. Also I want to integrate this with Apache Spark. Is it possible? My aim is I need to load different tables from different sources like Oracle, MS SQL, and HDFS fil...
Integrate Spark SQL using Pyspark with python interpreter and pandas and Ipython notebook
0
0
0
186
42,105,805
2017-02-08T06:03:00.000
0
0
1
0
python,api,microservices
42,114,560
2
false
0
0
Api gateway is not needed for Internal service to service communication But, you need a service registry or some kind of dynamic load balancing mechanism to reach the services
1
0
0
I would like to know how to create a communication for each services. I am using API Gateway for the outside of the system to communicate with the services within. Is it necessary for a service to call another service through API Gateway or just directly into the service itself ? Thank You
Microservices Communication Design
0
0
1
3,274
42,108,324
2017-02-08T08:40:00.000
0
0
0
0
python,machine-learning,scikit-learn,decision-tree
42,115,789
2
false
0
0
In general - no. Decision trees work differently that that. For example it could have a rule under the hood that if feature X > 100 OR X < 10 and Y = 'some value' than answer is Yes, if 50 < X < 70 - answer is No etc. In the instance of decision tree you may want to visualize its results and analyse the rules. With RF ...
1
0
1
I have trained my model on a data set and i used decision trees to train my model and it has 3 output classes - Yes,Done and No , and I got to know the feature that are most decisive in making a decision by checking feature importance of the classifier. I am using python and sklearn as my ML library. Now that I have fo...
How to know the factor by which a feature affects a model's prediction
0
0
0
998
42,109,930
2017-02-08T10:00:00.000
2
0
0
0
c#,python-2.7,ironpython,roslyn
42,208,014
1
true
1
1
Found. IronPython can use c# classes, using import and change initializer invocation value= new SomeObject { Name = name } to value = SomeObject(Name = name)
1
1
0
Well, need to translate c# code into IronPython. The current problem is to find the best way to traslate initialization like this for example: case SomeObject.FieldCase: new SomeObject { Width = 600, Height = 400 }.Export(model_, stream); break; Do you have any ideas to make it similar? I'm interesting only in object i...
Object initialization in IronPython
1.2
0
0
356
42,110,293
2017-02-08T10:16:00.000
0
0
0
0
python,matlab,tensorflow
54,422,825
3
false
0
0
I used a mex function for inference via the C++ API of TensorFlow once. That's pretty straight forward. I had to link the required TensorFlow libs statically from source though.
1
1
1
I want to integrate MATLAB and TensorFlow, although I can run TensorFlow native in python but I am required to use MATLAB for image processing. Can someone please help me out with this one?
How will I integrate MATLAB to TensorFlow?
0
0
0
1,628