Q_CreationDate stringlengths 23 23 | Title stringlengths 11 149 | Question stringlengths 25 6.53k | Answer stringlengths 15 5.1k | Score float64 -1 1.2 | Is_accepted bool 2
classes | N_answers int64 1 17 | Q_Id int64 0 6.76k |
|---|---|---|---|---|---|---|---|
2018-11-15 11:25:13.747 | How Do I store downloaded pdf files to Mongo DB | I download the some of pdf and stored in directory. Need to insert them into mongo database with python code so how could i do these. Need to store them by making three columns (pdf_name, pdf_ganerateDate, FlagOfWork)like that. | You can use GridFS. Please check this url http://api.mongodb.com/python/current/examples/gridfs.html.
It will help you to store any file to mongoDb and get them. In other collection you can save file metadata. | 0.386912 | false | 1 | 5,821 |
2018-11-15 15:28:09.797 | how to use pipenv to run file in current folder | Using pipenv to create a virtual environment in a folder.
However, the environment seems to be in the path:
/Users/....../.local/share/virtualenvs/......
And when I run the command pipenv run python train.py, I get the error:
can't open file 'train.py': [Errno 2] No such file or directory
How to run a file in th... | You need to be in the same directory of the file you want to run then use:
pipenv run python train.py
Note:
You may be at the project main directory while the file you need to run is inside a directory inside your project directory
If you use django to create your project, it will create two folders inside each other ... | 1.2 | true | 1 | 5,822 |
2018-11-15 20:21:37.897 | xgboost feature importance of categorical variable | I am using XGBClassifier to train in python and there are a handful of categorical variables in my training dataset. Originally, I planed to convert each of them into a few dummies before I throw in my data, but then the feature importance will be calculated for each dummy, not the original categorical ones. Since I al... | You could probably get by with summing the individual categories' importances into their original, parent category. But, unless these features are high-cardinality, my two cents would be to report them individually. I tend to err on the side of being more explicit with reporting model performance/importance measures. | 0 | false | 1 | 5,823 |
2018-11-15 20:22:49.817 | How to run a briefly running Docker container on Azure on a daily basis? | In the past, I've been using WebJobs to schedule small recurrent tasks that perform a specific background task, e.g., generating a daily summary of user activities. For each task, I've written a console application in C# that was published as an Azure Webjob.
Now I'd like to daily execute some Python code that is alrea... | I'd probably write a scheduled build job on vsts\whatever to run at 1am daily to launch a container on Azure Container Instances. Container should shutdown on its own when the program exists (so your program has to do that without help from outside). | 1.2 | true | 1 | 5,824 |
2018-11-16 16:47:57.803 | MongoDB - how can i set a documents limit to my capped collection? | I'm fairly new to MongoDB. I need my Python script to query new entries from my Database in real time, but the only way to do this seems to be replica sets, but my Database is not a replica set, or with a Tailable cursor, which is only for capped collections.
From what i understood, a capped collection has a limit, but... | so do you want to increase the size of capped collection ?
if yes then if you know average document size then you may define size like:
db.createCollection("sample", { capped : true, size : 10000000, max : 5000000 } ) here 5000000 is max documents with size limit of 10000000 bytes | 0.386912 | false | 1 | 5,825 |
2018-11-17 02:57:21.293 | Import aar of Android library in Python | I have wrote an Android library and build an aar file. And I want to write a python program to use the aar library. Is it possible to do that? If so, how to do that? Thanks | There is no way to include all dependencies to your aar file. So According to the open source licenses you can add their sources to your project. | 0 | false | 1 | 5,826 |
2018-11-17 12:15:24.270 | GraphQL/Graphene for backend calls in Django's templates | I just installed Graphene on my Django project and would like to use it also for the back-end, templating. So far, I find just tutorials how to use it only for front-end, no mention about back-end.
Should I suppose that it is not a good idea to use it instead of a SQL database? If yes, then why? Is there a downside i... | GraphQL is an API specification. It doesn't specify how data is stored, so it is not a replacement for a database.
If you're using GraphQL, you don't use Django templates to specify the GraphQL output, because GraphQL specifies the entire HTTP response from the web service, so this question doesn't make sense. | 0.673066 | false | 1 | 5,827 |
2018-11-17 18:20:40.807 | How to use F-score as error function to train neural networks? | I am pretty new to neural networks. I am training a network in tensorflow, but the number of positive examples is much much less than negative examples in my dataset (it is a medical dataset).
So, I know that F-score calculated from precision and recall is a good measure of how well the model is trained.
I have used ... | the loss value and accuracy is a different concept. The loss value is used for training the NN. However, accuracy or other metrics is to value the training result. | 0 | false | 1 | 5,828 |
2018-11-17 20:57:16.567 | How to determine file path in Google colab? | I mounted my drive using this :
from google.colab import drive
drive.mount('/content/drive/')
I have a file inside a folder that I want the path of how do I determine the path?
Say the folder that contains the file is named 'x' inside my drive | The path will be /content/drive/My\ Drive/x/the_file. | 1.2 | true | 2 | 5,829 |
2018-11-17 20:57:16.567 | How to determine file path in Google colab? | I mounted my drive using this :
from google.colab import drive
drive.mount('/content/drive/')
I have a file inside a folder that I want the path of how do I determine the path?
Say the folder that contains the file is named 'x' inside my drive | The path as parameter for a function will be /content/drive/My Drive/x/the_file, so without backslash inside My Drive | 0.545705 | false | 2 | 5,829 |
2018-11-17 23:12:26.597 | virtualenv - Birds Eye View of Understanding | Using Windows
Learning about virtualenv. Here is my understanding of it and a few question that I have. Please correct me if my understanding is incorrect.
virtualenv are environments where your pip dependencies and its selected version are stored for a particular project. A folder is made for your project and inside ... | virtualenv simply creates a new Python environment for your project. Think of it as another copy of Python that you have in your system. Virutual environment is helpful for development, especially if you will need different versions of the same libraries.
Answer to your first question is, yes, for each project that you... | 0 | false | 2 | 5,830 |
2018-11-17 23:12:26.597 | virtualenv - Birds Eye View of Understanding | Using Windows
Learning about virtualenv. Here is my understanding of it and a few question that I have. Please correct me if my understanding is incorrect.
virtualenv are environments where your pip dependencies and its selected version are stored for a particular project. A folder is made for your project and inside ... | * disclaimer * I mainly use conda environments instead of virtualenv, but I believe that most of this is the same across both of them and is true to your case.
You should be able to access your scripts from any environment you are in. If you have virtenvA and virtenvB then you can access your script from inside either... | 0 | false | 2 | 5,830 |
2018-11-19 08:19:34.017 | How do I efficiently understand a framework with sparse documentation? | I have the problem that for a project I need to work with a framework (Python), that has a poor documentation. I know what it does since it is the back end of a running application. I also know that no framework is good if the documentation is bad and that I should prob. code it myself. But, I have a time constraint. T... | If I were you, with time constaraints, and bound to use a specific framework. I'll go in the following manner:
List down the use cases I desire to implement using the framework
Identify the APIs provided by the framework that helps me implement the use cases
Prototype the usecases based on the available documentatio... | 0.386912 | false | 1 | 5,831 |
2018-11-20 02:45:03.200 | Python concurrent.futures.ThreadPoolExecutor max_workers | I am searching for a long time on net. But no use. Please help or try to give me some ideas how to achieve this.
When I use python module concurrent.futures.ThreadPoolExecutor(max_workers=None), I want to know the max_workers how much the number of suitable.
I've read the official document.
I still don't know the numbe... | max_worker, you can take it as threads number.
If you want to make the best of CPUs, you should keep it running (instead of sleeping).
Ideally if you set it to None, there will be ( CPU number * 5) threads at most. On average, each CPU has 5 thread to schedule. Then if one of them falls into sleep, another thread will ... | 0.999909 | false | 1 | 5,832 |
2018-11-20 20:23:47.973 | wget with subprocess.call() | I'm working on a domain fronting project. Basically I'm trying to use the subprocess.call() function to interpret the following command:
wget -O - https://fronteddomain.example --header 'Host: targetdomain.example'
With the proper domains, I know how to domain front, that is not the problem. Just need some help with wr... | I figured it out using curl:
call(["curl", "-s", "-H" "Host: targetdomain.example", "-H", "Connection: close", "frontdomain.example"]) | 1.2 | true | 1 | 5,833 |
2018-11-20 23:58:45.450 | How to install Poppler to be used on AWS Lambda | I have to run pdf2image on my Python Lambda Function in AWS, but it requires poppler and poppler-utils to be installed on the machine.
I have tried to search in many different places how to do that but could not find anything or anyone that have done that using lambda functions.
Would any of you know how to generate p... | Hi @Alex Albracht thanks for compiled easy instructions! They helped a lot. But I really struggled with getting the lambda function find the poppler path. So, I'll try to add that up with an effort to make it clear.
The binary files should go in a zip folder having structure as:
poppler.zip -> bin/poppler
where poppler... | 0 | false | 1 | 5,834 |
2018-11-21 13:30:25.713 | CPLEX Error 1016: Promotional version , use academic version CPLEX | I am using python with clpex, when I finished my model I run the program and it throws me the following error:
CplexSolverError: CPLEX Error 1016: Promotional version. Problem size limits exceeded.
I have the IBM Academic CPLEX installed, how can I make python recognize this and not the promotional version? | you can go to the direction you install CPLEX. For Example, D:\Cplex
After that you will see a foler name cplex, then you click on that, --> python --> choose the version of your python ( Ex: 3.6 ), then choose the folder x64_win64, you will see another file name cplex.
You copy this file into your python site packakg... | 1.2 | true | 1 | 5,835 |
2018-11-23 22:49:20.307 | How can i create a persistent data chart with Flask and Javascript? | I want to add a real-time chart to my Flask webapp. This chart, other than current updated data, should contain historical data too.
At the moment i can create the chart and i can make it real time but i have no idea how to make the data 'persistent', so i can't see what the chart looked like days or weeks ago.
I'm usi... | You can try to store the data in a database and or in a file and extract from there .
You can also try to use dash or you can make on the right side a menu with dates like 21 september and see the chart from that day .
For dash you can look on YouTube at Sentdex | 0 | false | 1 | 5,836 |
2018-11-25 13:55:55.643 | How do I count how many items are in a specific row in my RDD | as you can tell I’m fairly new to using Pyspark Python my RDD is set out as follows:
(ID, First name, Last name, Address)
(ID, First name, Last name, Address)
(ID, First name, Last name, Address)
(ID, First name, Last name, Address)
(ID, First name, Last name, Address)
Is there anyway I can count how many of these rec... | If you have RDD of tuples like RDD[(ID, First name, Last name, Address)] then you can perform below operation to do different types of counting.
Count the total number of elements/Rows in your RDD.
rdd.count()
Count Distinct IDs from your above RDD. Select the ID element and then do a distinct on top of it.
rdd.map(la... | 0 | false | 1 | 5,837 |
2018-11-25 19:22:29.680 | Adding charts to a Flask webapp | I created a web app with Flask where I'll be showing data, so I need charts for it.
The problem is that I don't really know how to do that, so I'm trying to find the best way to do that. I tried to use a Javascript charting library on my frontend and send the data to the chart using SocketIO, but the problem is that I ... | Try to use dash is a python library for web charts | 1.2 | true | 1 | 5,838 |
2018-11-25 22:35:57.257 | How to strip off left side of binary number in Python? | I got this binary number 101111111111000
I need to strip off the 8 most significant bits and have 11111000 at the end.
I tried to make 101111111111000 << 8, but this results in 10111111111100000000000, it hasn't the same effect as >> which strips the lower bits. So how can this be done? The final result MUST BE binary ... | To achieve this for a number x with n digits, one can use this
x&(2**(len(bin(x))-2-8)-1)
-2 to strip 0b, -8 to strip leftmost
Simply said it ands your number with just enough 1s that the 8 leftmost bits are set to 0. | 0 | false | 1 | 5,839 |
2018-11-26 06:17:56.463 | how do I clear a printed line and replace it with updated variable IDLE | I need to clear a printed line, but so far I have found no good answers for using python 3.7, IDLE on windows 10. I am trying to make a simple code that prints a changing variable. But I don't want tons of new lines being printed. I want to try and get it all on one line.
Is it possible to print a variable that has bee... | The Python language definition defines when bytes will be sent to a file, such as sys.stdout, the default file for print. It does not define what the connected device does with the bytes.
When running code from IDLE, sys.stdout is initially connected to IDLE's Shell window. Shell is not a terminal and does not interp... | 0.386912 | false | 1 | 5,840 |
2018-11-27 09:51:12.057 | how to run python in eclipse with both py2 and py3? | pre:
I installed both python2.7 and python 3.70
eclipse installed pydev, and configured two interpreters for each py version
I have a project with some py scripts
question:
I choose one py file, I want run it in py2, then i want it run in py3(manually).
I know that each file cound has it's run configuration, but it c... | I didn't understand what's the actual workflow you want...
Do you want to run each file on a different interpreter (say you have mod1.py and want to run it always on py2 and then mod2.py should be run always on py3) or do you want to run the same file on multiple interpreters (i.e.: you have mod1.py and want to run it ... | 0.386912 | false | 1 | 5,841 |
2018-11-27 23:32:32.593 | Python regex to identify capitalised single word lines in a text abstract | I am looking for a way to extract words from text if they match the following conditions:
1) are capitalised
and
2) appear on a new line on their own (i.e. no other text on the same line).
I am able to extract all capitalised words with this code:
caps=re.findall(r"\b[A-Z]+\b", mytext)
but can't figure out how to im... | please try following statements \r\n at the begining of your regex expression | -0.201295 | false | 1 | 5,842 |
2018-11-28 12:15:31.400 | Python and Dart Integration in Flutter Mobile Application | Can i do these two things:
Is there any library in dart for Sentiment Analysis?
Can I use Python (for Sentiment Analysis) in dart?
My main motive for these questions is that I'm working on an application in a flutter and I use sentiment analysis and I have no idea that how I do that.
Can anyone please help me to s... | You can create an api using Python then serve it your mobile app (FLUTTER) using http requests.
I | 0.673066 | false | 1 | 5,843 |
2018-11-28 15:25:07.900 | Why is LocationLocal: Relative Alt dropping into negative values on a stationary drone? | I'm running the Set_Attitude_Target example on an Intel Aero with Ardupilot. The code is working as intended but on top of a clear sensor error, that becomes more evident the longer I run the experiment.
In short, the altitude report from the example is reporting that in LocationLocal there is a relative altitude of -0... | As per Agustinus Baskara's comment on the original post, it would appear the built-in sensor is simply that bad - it can't be improved upon with software. | 0 | false | 1 | 5,844 |
2018-11-29 00:38:11.560 | The loss function and evaluation metric of XGBoost | I am confused now about the loss functions used in XGBoost. Here is how I feel confused:
we have objective, which is the loss function needs to be minimized; eval_metric: the metric used to represent the learning result. These two are totally unrelated (if we don't consider such as for classification only logloss and ... | 'binary:logistic' uses -(y*log(y_pred) + (1-y)*(log(1-y_pred)))
'reg:logistic' uses (y - y_pred)^2
To get a total estimation of error we sum all errors and divide by number of samples.
You can find this in the basics. When looking on Linear regression VS Logistic regression.
Linear regression uses (y - y_pred)^2 as th... | 0.999967 | false | 1 | 5,845 |
2018-11-29 09:16:08.143 | After I modified my Python code in Pycharm, how to deploy the change to my Portainer? | Perhaps it is a basic question but I am really not a profession in Portainer.
I have a local Portainer, a Pycharm to manage the Python code. What should I do after I modified my code and deploy this change to the local Portainer?
Thx | If you have mounted the folder where your code resides directly in the container the changes will be also be applied in your container so no further action is required.
If you have not mounted the folder to your container (for example if you copy the code when you build the image), you would have to rebuild the image. ... | 0 | false | 1 | 5,846 |
2018-11-30 04:23:07.330 | Sqlalchemy before_execute event - how to pass some external variable, say app user id? | I am trying to obtain an application variable (app user id) in before_execute(conn, clauseelement, multiparam, param) method. The app user id is stored in python http request object which I do not have any access to in the db event.
Is there any way to associate a piece of sqlalchemy external data somewhere to fetch it... | Answering my own question here with a possible solution :)
From http request copied the piece of data to session object
Since the session binding was at engine level, copied the data from session to connection object in SessionEvent.after_begin(session, transaction, connection). [Had it been Connection level binding, ... | 0 | false | 1 | 5,847 |
2018-11-30 05:17:50.717 | Session cookie is too large flask application | I'm trying to load certain data using sessions (locally) and it has been working for some time but, now I get the following warning and my data that was loaded through sessions is no longer being loaded.
The "b'session'" cookie is too large: the value was 13083 bytes but
the header required 44 extra bytes. The final... | It looks like you are using the client-side type of session that is set by default with Flask which has a limited capacity of 4KB. You can use a server-side type session that will not have this limit, for example, by using a back-end file system (you save the session data in a file system in the server, not in the brow... | 1.2 | true | 1 | 5,848 |
2018-11-30 12:32:27.360 | not having to load a dataset over and over | Currently in R, once you load a dataset (for example with read.csv), Rstudio saves it as a variable in the global environment. This ensures you don't have to load the dataset every single time you do a particular test or change.
With Python, I do not know which text editor/IDE will allow me to do this. E.G - I want to... | It depends how large your data set is.
For relatively smaller datasets you could look at installing Anaconda Python Jupyter notebooks. Really great for working with data and visualisation once the dataset is loaded. For larger datasets you can write some functions / generators to iterate efficiently through the datase... | 0 | false | 1 | 5,849 |
2018-11-30 14:16:09.813 | pymysql - Get value from a query | I am executing the query using pymysql in python.
select (sum(acc_Value)) from accInfo where acc_Name = 'ABC'
The purpose of the query is to get the sum of all the values in acc_Value column for all the rows matchin acc_Name = 'ABC'.
The output i am getting when using cur.fetchone() is
(Decimal('256830696'),)
Now... | It's a tuple, just take the 0th index | -0.386912 | false | 1 | 5,850 |
2018-12-01 14:09:56.980 | Saving objects from tk canvas | I'm trying to make a save function in a program im doing for bubbling/ballooning drawings. The only thing I can't get to work is save a "work copy". As if a drawing gets revision changes, you don't need to redo all the work. Just load the work copy, and add/remove/re-arrage bubbles.
I'm using tkinter and canvas. And cr... | There is no built-in way to save and restore the canvas. However, the canvas has methods you can use to get all of the information about the items on the canvas. You can use these methods to save this information to a file and then read this file back and recreate the objects.
find_all - will return an ordered list o... | 1.2 | true | 1 | 5,851 |
2018-12-03 01:15:30.087 | Different sized vectors in word2vec | I am trying to generate three different sized output vectors namely 25d, 50d and 75d. I am trying to do so by training the same dataset using the word2vec model. I am not sure how I can get three vectors of different sizes using the same training dataset. Can someone please help me get started on this? I am very new to... | You run the code for one model three times, each time supplying a different vector_size parameter to the model initialization. | 1.2 | true | 1 | 5,852 |
2018-12-03 03:23:29.990 | data-item-url is on localhost instead of pythonanywhere (wagtail + snipcart project) | So instead of having data-item-url="https://miglopes.pythonanywhere.com/ra%C3%A7%C3%A3o-de-c%C3%A3o-purina-junior-10kg/"
it keeps on appearing
data-item-url="http://localhost/ra%C3%A7%C3%A3o-de-c%C3%A3o-purina-junior-10kg/"
how do i remove the localhost so my snipcart can work on checkout? | Without more details of where this tag is coming from it's hard to know for sure... but most likely you need to update your site's hostname in the Wagtail admin, under Settings -> Sites. | 0 | false | 1 | 5,853 |
2018-12-03 21:09:40.843 | Using MFCC's for voice recognition | I'm currently using the Fourier transformation in conjunction with Keras for voice recogition (speaker identification). I have heard MFCC is a better option for voice recognition, but I am not sure how to use it.
I am using librosa in python (3) to extract 20 MFCC features. My question is: which MFCC features should I ... | You can use MFCCs with dense layers / multilayer perceptron, but probably a Convolutional Neural Network on the mel-spectrogram will perform better, assuming that you have enough training data. | 0 | false | 1 | 5,854 |
2018-12-04 18:22:55.240 | How to add text to a file in python3 | Let's say i have the following file,
dummy_file.txt(contents below)
first line
third line
how can i add a line to that file right in the middle so the end result is:
first line
second line
third line
I have looked into opening the file with the append option, however that adds the line to the end of the file. | The standard file methods don't support inserting into the middle of a file. You need to read the file, add your new data to the data that you read in, and then re-write the whole file. | 1.2 | true | 1 | 5,855 |
2018-12-05 08:13:04.893 | DataFrame view in PyCharm when using pyspark | I create a pyspark dataframe and i want to see it in the SciView tab in PyCharm when i debug my code (like I used to do when i have worked with pandas).
It says "Nothing to show" (the dataframe exists, I can see it when I use the show() command).
someone knows how to do it or maybe there is no integration between pycha... | Pycharm does not support spark dataframes, you should call the toPandas() method on the dataframe. As @abhiieor mentioned in a comment, be aware that you can potentially collect a lot of data, you should first limit() the number of rows returned. | 1.2 | true | 1 | 5,856 |
2018-12-08 01:12:11.607 | Is it possible to trigger a script or program if any data is updated in a database, like MySQL? | It doesn't have to be exactly a trigger inside the database. I just want to know how I should design this, so that when changes are made inside MySQL or SQL server, some script could be triggered. | One Way would be to keep a counter on the last updated row in the database, and then you need to keep polling(Checking) the database through python for new records in short intervals.
If the value in the counter is increased then you could use the subprocess module to call another Python script. | 0 | false | 1 | 5,857 |
2018-12-09 22:47:38.660 | Error for word2vec with GoogleNews-vectors-negative300.bin | the version of python is 3.6
I tried to execute my code but, there are still some errors as below:
Traceback (most recent call last):
File
"C:\Users\tmdgu\Desktop\NLP-master1\NLP-master\Ontology_Construction.py",
line 55, in
, binary=True)
File "E:\Program
Files\Python\Python35-32\lib\site-packages\gensim... | This is just a warning, not a fatal error. Your code likely still works.
"Deprecation" means a function's use has been marked by the authors as no longer encouraged.
The function typically still works, but may not for much longer – becoming unreliable or unavailable in some future library release. Often, there's a new... | 0.673066 | false | 1 | 5,858 |
2018-12-11 00:40:44.053 | Use of Breakpoint Method | I am new to python and am unsure of how the breakpoint method works. Does it open the debugger for the IDE or some built-in debugger?
Additionally, I was wondering how that debugger would be able to be operated.
For example, I use Spyder, does that mean that if I use the breakpoint() method, Spyder's debugger will open... | No, debugger will not open itself automatically as a consequence of setting a breakpoint.
So you have first set a breakpoint (or more of them), and then manually launch a debugger.
After this, the debugger will perform your code as usually, but will stop performing instructions when it reaches a breakpoint - the instru... | 1.2 | true | 1 | 5,859 |
2018-12-11 01:14:39.167 | Is there an appropriate version of Pygame for Python 3.7 installed with Anaconda? | I'm new to programming and I just downloaded Anaconda a few days ago for Windows 64-bit. I came across the Invent with Python book and decided I wanted to work through it so I downloaded that too. I ended up running into a couple issues with it not working (somehow I ended up with Spyder (Python 2.7) and end=' ' wasn't... | just use pip install pygame & python will look for a version compatible with your installation.
If you're using Anaconda and pip doesn't work on CMD prompt, try using the Anaconda prompt from start menu. | 0.673066 | false | 1 | 5,860 |
2018-12-11 17:54:00.677 | python-hypothesis: Retrieving or reformatting a falsifying example | Is it possible to retrieve or reformat the falsifying example after a test failure? The point is to show the example data in a different format - data generated by the strategy is easy to work with in the code but not really user friendly, so I'm looking at how to display it in a different form. Even a post-mortem tool... | Even a post-mortem tool working with the example database would be enough, but there does not seem to be any API allowing that, or am I missing something?
The example database uses a private format and only records the choices a strategy made to generate the falsifying example, so there's no way to extract the data of... | 0 | false | 1 | 5,861 |
2018-12-11 19:43:33.823 | Template rest one day from the date | In my view.py I obtain a date from my MSSQL database in this format 2018-12-06 00:00:00.000 so I pass that value as context like datedb and in my html page I render it like this {{datedb|date:"c"}} but it shows the date with one day less like this:
2018-12-05T18:00:00-06:00
Is the 06 not the 05 day.
why is this happe... | One way of solve the problem was chage to USE_TZ = False has Willem said in the comments, but that gives another error so I found the way to do it just adding in the template this {% load tz %} and using the flter |utc on the date variables like datedb|utc|date:'Y-m-d'. | 1.2 | true | 1 | 5,862 |
2018-12-12 12:15:09.190 | Add full anaconda package list to existing conda environment | I know how to add single packages and I know that the conda create command supports adding a new environment with all anaconda packages installed.
But how can I add all anaconda packages to an existing environment? | I was able to solve the problem as following:
Create a helper env with anaconda: conda create -n env_name anaconda
Activate that env conda activate env_name
Export packages into specification file: conda list --explicit > spec-file.txt
Activate the target environment: activate target_env_name
Import that specification... | 0.386912 | false | 1 | 5,863 |
2018-12-12 17:20:31.293 | how to compare two text document with tfidf vectorizer? | I have two different text which I want to compare using tfidf vectorization.
What I am doing is:
tokenizing each document
vectorizing using TFIDFVectorizer.fit_transform(tokens_list)
Now the vectors that I get after step 2 are of different shape.
But as per the concept, we should have the same shape for both the vect... | As G. Anderson already pointed out, and to help the future guys on this, when we use the fit function of TFIDFVectorizer on document D1, it means that for the D1, the bag of words are constructed.
The transform() function computes the tfidf frequency of each word in the bag of word.
Now our aim is to compare the docum... | 1.2 | true | 1 | 5,864 |
2018-12-13 13:43:34.987 | python, dictionaries how to get the first value of the first key | So basically I have a dictionary with x and y values and I want to be able to get only the x value of the first coordinate and only the y value of the first coordinate and then the same with the second coordinate and so on, so that I can use it in an if-statement. | if the values are ordered in columns just use
x=your_variable[:,0] y=your_variable[:,1]
i think | 0.386912 | false | 1 | 5,865 |
2018-12-15 21:55:17.020 | how to install tkinter with Pycharm? | I used sudo apt-get install python3.6-tk and it works fine. Tkinter works if I open python in terminal, but I cannot get it installed on my Pycharm project. pip install command says it cannot find Tkinter. I cannot find python-tk in the list of possible installs either.
Is there a way to get Tkinter just standard into... | Python already has tkinter installed. It is a base module, like random or time, therefore you don't need to install it. | -0.067922 | false | 1 | 5,866 |
2018-12-18 01:57:32.877 | Print output to console while redirect the output to a file in linux | I am using python in linux and tried to use command line to print out the output log while redirecting the output and error to a txt.file. However, after I searched and tried the methods such as
python [program] 2>&1 | tee output.log
But it just redirected the output the the output.log and the print content disappeare... | You can create a screen like this: screen -L and then run the python script in this screen which would give the output to the console and also would save it the file: screenlog.0. You could leave the screen by using Ctrl+A+D while the script is running and check the script output by reattaching to the screen by screen ... | 0 | false | 1 | 5,867 |
2018-12-18 10:17:19.160 | Regex for Sentences in python | I have one more Query
here is two sentences
[1,12:12] call basic_while1() Error Code: 1046. No database selected
[1,12:12] call add() Asdfjgg Error Code: 1046. No database selected
[1,12:12] call add()
[1,12:12]
Error Code: 1046. No database selected
now I want to get output like this
['1','12:12',"call basic_while1... | basically you asked to get everything before the "Error Code"
I want to cut everything exact before "Error Code"
so it is simple, try: find = re.search('((.)+)(\sError Code)*',s) and find.group(1) will give you '[1,12:12] call add() Asdfjgg' which is what you wanted.
if after you got that string you want list that yo... | 0 | false | 1 | 5,868 |
2018-12-18 23:09:13.550 | install numpy on python 3.5 Mac OS High sierra | I wanted to install the numpy package for python 3.5 on my Mac OS High Sierra, but I can't seem to make it work.
I have it on python2.7, but I would also like to install it for the next versions.
Currently, I have installed python 2.7, python 3.5, and python 3.7.
I tried to install numpy using:
brew install numpy --w... | First, you need to activate the virtual environment for the version of python you wish to run. After you have done that then just run "pip install numpy" or "pip3 install numpy".
If you used Anaconda to install python then, after activating your environment, type conda install numpy. | 1.2 | true | 2 | 5,869 |
2018-12-18 23:09:13.550 | install numpy on python 3.5 Mac OS High sierra | I wanted to install the numpy package for python 3.5 on my Mac OS High Sierra, but I can't seem to make it work.
I have it on python2.7, but I would also like to install it for the next versions.
Currently, I have installed python 2.7, python 3.5, and python 3.7.
I tried to install numpy using:
brew install numpy --w... | If running pip3.5 --version or pip3 --version works, what is the output when you run pip3 freeze? If there is no output, it indicates that there are no packages installed for the Python 3 environment and you should be able to install numpy with pip3 install numpy. | 0 | false | 2 | 5,869 |
2018-12-19 15:33:16.960 | Python Vscode extension - can't change remote jupyter notebook kernel | I've got the updated Python VSCode extension installed and it works great. I'm able to use the URL with the token to connect to a remote Jupyter notebook. I just cannot seem to figure out how to change the kernel on the remote notebook for use in VSCode.
If I connect to the remote notebook through a web browser, I ca... | The command that worked for me in vscode:
Notebook: Select Notebook Kernel | 0 | false | 2 | 5,870 |
2018-12-19 15:33:16.960 | Python Vscode extension - can't change remote jupyter notebook kernel | I've got the updated Python VSCode extension installed and it works great. I'm able to use the URL with the token to connect to a remote Jupyter notebook. I just cannot seem to figure out how to change the kernel on the remote notebook for use in VSCode.
If I connect to the remote notebook through a web browser, I ca... | Run the following command in vscode:
Python: Select interpreter to start Jupyter server
It will allow you to choose the kernel that you want. | 0 | false | 2 | 5,870 |
2018-12-21 02:43:43.240 | Backtesting a Universe of Stocks | I would like to develop a trend following strategy via back-testing a universe of stocks; lets just say all NYSE or S&P500 equities. I am asking this question today because I am unsure how to handle the storage/organization of the massive amounts of historical price data.
After multiple hours of research I am here, as... | The amout of data is too much for EXCEL or CALC. Even if you want to screen only 500 Stocks from S&P 500, you will get 2,2 Millions of rows (approx. 220 days/year * 20 years * 500 stocks). For this amount of data, you should use a SQL Database like MySQL. It is performant enough to handle this amount of data. But you h... | 0 | false | 1 | 5,871 |
2018-12-21 11:15:31.803 | Date Range for Facebook Graph API request on posts level | I am working on a tool for my company created to get data from our Facebook publications. It has not been working for a while, so I have to get all the historical data from June to November 2018.
My two scripts (one that get title and type of publication, and the other that get the number of link clicks) are workin... | So it seems that it is not possible to request this kind of data unfortunately, third party services must be used... | 0 | false | 1 | 5,872 |
2018-12-23 03:14:14.787 | Pyautogui mouse click on different resolution | I'm writing a script for automatizing some tasks at my job. However, I need to make my script portable and try it on different screen resolution.
So far right now I've tried to multiply my coordinate with the ratio between the old and new resolutions, but this doesn't work properly.
Do you know how I can convert my X,... | Quick question: Are you trying to get it to click on certain buttons? (i.e. buttons that look the same on every computer you plug it into) And by portable, do you mean on a thumb drive (usb)?
You may be able to take an image of the button (i.e. cropping a screenshot), pass it on to the opencv module, one of the modules... | 0.386912 | false | 1 | 5,873 |
2018-12-24 13:58:52.250 | extracting text just after a particular tag using beautifulsoup? | I need to extract the text just after strong tag from html page given below? how can i do it using beautiful soup. It is causing me problem as it doesn't have any class or id so only way to select this tag is using text.
{strong}Name:{/strong} Sam smith{br}
Required result
Sam smith | Thanks for all your answers but i was able to do this by following:
b_el = soup.find('strong',text='Name:')
print b_el.next_sibling
This works fine for me. This prints just next sibling how can i print next 2 sibling is there anyway ? | -0.386912 | false | 1 | 5,874 |
2018-12-25 10:26:24.547 | How to train your own model in AWS Sagemaker? | I just started with AWS and I want to train my own model with own dataset. I have my model as keras model with tensorflow backend in Python. I read some documentations, they say I need a Docker image to load my model. So, how do I convert keras model into Docker image. I searched through internet but found nothing that... | You can convert your Keras model to a tf.estimator and train using the TensorFlow framework estimators in Sagemaker.
This conversion is pretty basic though, I reimplemented my models in TensorFlow using the tf.keras API which makes the model nearly identical and train with the Sagemaker TF estimator in script mode.
My ... | 0 | false | 1 | 5,875 |
2018-12-25 21:14:39.453 | Installing Python Dependencies locally in project | I am coming from NodeJS and learning Python and was wondering how to properly install the packages in requirements.txt file locally in the project.
For node, this is done by managing and installing the packages in package.json via npm install. However, the convention for Python project seems to be to add packages to a ... | use this command
pip install -r requirements.txt -t <path-to-the-lib-directory> | 1.2 | true | 1 | 5,876 |
2018-12-26 11:44:32.850 | P4Python check if file is modified after check-out | I need to check-in the file which is in client workspace. Before check-in i need to verify if the file has been changed. Please tell me how to check this. | Use the p4 diff -sr command. This will do a diff of opened files and return the names of ones that are unchanged. | 1.2 | true | 1 | 5,877 |
2018-12-26 21:26:16.360 | How can I source two paths for the ROS environmental variable at the same time? | I have a problem with using the rqt_image_view package in ROS. Each time when I type rqt_image_view or rosrun rqt_image_view rqt_image_view in terminal, it will return:
Traceback (most recent call last):
File "/opt/ros/kinetic/bin/rqt_image_view", line 16, in
plugin_argument_provider=add_arguments))
F... | Different solutions to try:
It sounds like the first path /eda/gazebo/ros/kinetic/share or /home/kelu/Dropbox/GET_Lab/leap_ws/src has an rqt_image_view package that is being used. Try to remove that dependency.
Have you tried switching the source files being sourced? This depends on how the rqt_image_view package was ... | 0 | false | 1 | 5,878 |
2018-12-27 09:49:47.840 | how to constrain scipy curve_fit in positive result | I'm using scipy curve_fit to curve a line for retention. however, I found the result line may produce negative number. how can i add some constrain?
the 'bounds' only constrain parameters not the results y | One of the simpler ways to handle negative value in y, is to make a log transformation. Get the best fit for log transformed y, then do exponential transformation for actual error in the fit or for any new value prediction. | 0 | false | 1 | 5,879 |
2018-12-27 10:57:53.617 | Vpython using Spyder : how to prevent browser tab from opening? | I am using vpython library in spyder. After importing the library when I call simple function like print('x') or carry out any assignment operation and execute the program, immediately a browser tab named localhost and port address opens up and I get the output in console {if I used print function}.
I would like to kn... | There is work in progress to prevent the opening of a browser tab when there are no 3D objects or graph to display. I don't know when this will be released. | 0 | false | 1 | 5,880 |
2018-12-27 16:54:21.267 | ImportError: cannot import name 'AFAVSignature' | I get this error after already having installed autofocus when I try to run a .py file from the command line that contains the line:
from autofocus import Autofocus2D
Output:
ImportError: cannot import name 'AFAVSignature'
Is anyne familiar with this package and how to import it?
Thanks | It doesn't look like the library is supported for python 3. I was getting the same error, but removed that line from init.py and found that there was another error with of something like 'print e' not working, so I put the line back in and imported with python2 and it worked. | 0 | false | 1 | 5,881 |
2018-12-28 00:04:02.473 | how can I find out which python virtual environment I am using? | I have several virtual environment in my computer and sometimes I am in doubt about which python virtual environment I am using. Is there an easy way to find out which virtual environment I am connected to? | Usually it's set to display in your prompt. You can also try typing in which python or which pip in your terminal to see if it points to you venv location, and which one. (Use where instead of which on Windows.) | 0.997458 | false | 2 | 5,882 |
2018-12-28 00:04:02.473 | how can I find out which python virtual environment I am using? | I have several virtual environment in my computer and sometimes I am in doubt about which python virtual environment I am using. Is there an easy way to find out which virtual environment I am connected to? | From a shell prompt, you can just do echo $VIRTUAL_ENV (or in Windows cmd.exe, echo %VIRTUAL_ENV%).
From within Python, sys.prefix provides the root of your Python installation (the virtual environment if active), and sys.executable tells you which Python executable is running your script. | 0.99039 | false | 2 | 5,882 |
2018-12-30 14:34:30.510 | how to delete django relation and rebuild model | ive made a mistake with my django and messed up my model
I want to delete it & then recreate it - how do I do that?
I get this when I try to migrate - i just want to drop it
relation "netshock_todo" already exists
Thanks in advance | Delete all of your migrations file except __init__.py
Then go to database and find migrations table, delete all row in migrations table. Then run makemigrations and migrate command | 1.2 | true | 1 | 5,883 |
2018-12-31 14:33:34.473 | Scrapy shell doesn't crawl web page | I am trying to use Scrapy shell to try and figure out the selectors for zone-h.org. I run scrapy shell 'webpage' afterwards I tried to view the content to be sure that it is downloaded. But all I can see is a dash icon (-). It doesn't download the page. I tried to enter the website to check if my connection to the webs... | Can you use scrapy shell "webpage" on another webpage that you know works/doesn't block scraping?
Have you tried using the view(response) command to open up what scrapy sees in a web browser?
When you go to the webpage using a normal browser, are you redirected to another, final homepage?
- if so, try using the final h... | 0 | false | 1 | 5,884 |
2019-01-03 23:22:36.667 | How to add to pythonpath in virtualenvironment | On my windows machine I created a virtual environement in conda where I run python 3.6. I want to permanently add a folder to the virtual python path environment. If I append something to sys.path it is lost on exiting python.
Outside of my virtual enviroment I can just add to user variables by going to advanced sys... | If you are on Windows 10+, this should work:
1) Click on the Windows button on the screen or on the keyboard, both in the bottom left section.
2) Type "Environment Variables" (without the quotation marks, of course).
3) Click on the option that says something like "Edit the System Environment Variables"
4) Click on th... | -0.201295 | false | 1 | 5,885 |
2019-01-04 08:03:05.297 | Do Dash apps reload all data upon client log in? | I'm wondering about how a dash app works in terms of loading data, parsing and doing initial calcs when serving to a client who logs onto the website.
For instance, my app initially loads a bunch of static local csv data, parses a bunch of dates and loads them into a few pandas data frames. This data is then displayed ... | The only thing that is called on every page load is the function you can assign to app.layout. This is useful if you want to display dynamic content like the current date on your page.
Everything else is just executed once when the app is starting.
This means if you load your data outside the app.layout (which I assum... | 1.2 | true | 1 | 5,886 |
2019-01-05 23:50:56.660 | How do i implement Logic to Django? | So I have an assignment to build a web interface for a smart sensor,
I've already written the python code to read the data from the sensor and write it into sqlite3, control the sensor etc.
I've built the HTML, CSS template and implemented it into Django.
My goal is to run the sensor reading script pararel to the Dja... | Place your code in app/appname/management/commands folder. Use Official guide for management commands. Then you will be able to use your custom command like this:
./manage getsensorinfo
So when you will have this command registered, you can just put in in cron and it will be executed every minute.
Secondly you need to... | 1.2 | true | 1 | 5,887 |
2019-01-06 02:49:09.817 | How does selenium work with hosting services? | I have a Flask app that uses selenium to get data from a website. I have spent 10+ hours trying to get heroku to work with it, but no success. My main problem is selenium. with heroku, there is a "buildpack" that you use to get selenium working with it, but with all the other hosting services, I have found no informati... | You need hosting service that able to install Chrome, chromedriver and other dependencies. Find for Virtual Private hosting (VPS), or Dedicated Server or Cloud Hosting but not Shared hosting. | 0 | false | 1 | 5,888 |
2019-01-06 10:28:46.997 | How do I root in python (other than square root)? | I'm trying to make a calculator in python, so when you type x (root) y it will give you the x root of y, e.g. 4 (root) 625 = 5.
I'm aware of how to do math.sqrt() but is there a way to do other roots? | If you want to 625^(1/4){which is the same as 4th root of 625}
then you type 625**(1/4)
** is the operator for exponents in python.
print(625**(1/4))
Output:
5.0
To generalize:
if you want to find the xth root of y, you do:
y**(1/x) | 0.673066 | false | 1 | 5,889 |
2019-01-08 17:44:43.800 | TF-IDF + Multiple Regression Prediction Problem | I have a dataset of ~10,000 rows of vehicles sold on a portal similar to Craigslist. The columns include price, mileage, no. of previous owners, how soon the car gets sold (in days), and most importantly a body of text that describes the vehicle (e.g. "accident free, serviced regularly").
I would like to find out whic... | As you mentioned you could only so much with the body of text, which signifies the amount of influence of text on selling the cars.
Even though the model gives very poor prediction accuracy, you could ahead to see the feature importance, to understand what are the words that drive the sales.
Include phrases in your t... | 1.2 | true | 1 | 5,890 |
2019-01-09 15:12:08.163 | Linux Jupyter Notebook : "The kernel appears to have died. It will restart automatically" | I am using the PYNQ Linux on Zedboard and when I tried to run a code on Jupyter Notebook to load a model.h5 I got an error message:
"The kernel appears to have died. It will restart automatically"
I tried to upgrade keras and Jupyter but still have the same error
I don't know how to fix this problem ? | Model is too large to be loaded into memory so kernel has died. | 0 | false | 1 | 5,891 |
2019-01-09 22:59:39.340 | Difference between Python Interpreter and IDLE? | For homework in my basic python class, we have to start python interpreter in interactive mode and type a statement. Then, we have to open IDLE and type a statement. I understand how to write statements in both, but can't quite tell them apart? I see that there are to different desktop apps for python, one being the py... | Python unlike some languages can be written one line at a time with you getting feedback after every line . This is called interactive mode. You will know you are in interactive mode if you see ">>>" on the far left side of the window. This mode is really only useful for doing small tasks you don't think will come up a... | 1.2 | true | 1 | 5,892 |
2019-01-10 15:30:10.413 | How to handle SQL dump with Python | I received a data dump of the SQL database.
The data is formatted in an .sql file and is quite large (3.3 GB). I have no idea where to go from here. I have no access to the actual database and I don't know how to handle this .sql file in Python.
Can anyone help me? I am looking for specific steps to take so I can use t... | It would be an extraordinarily difficult process to try to construct any sort of Python program that would be capable of parsing the SQL syntax of any such of a dump-file and to try to do anything whatsoever useful with it.
"No. Absolutely not. Absolute nonsense." (And I have over 30 years of experience, including sen... | 0.201295 | false | 2 | 5,893 |
2019-01-10 15:30:10.413 | How to handle SQL dump with Python | I received a data dump of the SQL database.
The data is formatted in an .sql file and is quite large (3.3 GB). I have no idea where to go from here. I have no access to the actual database and I don't know how to handle this .sql file in Python.
Can anyone help me? I am looking for specific steps to take so I can use t... | Eventually I had to install MAMP to create a local mysql server. I imported the SQL dump with a program like SQLyog that let's you edit SQL databases.
This made it possible to import the SQL database in Python using SQLAlchemy, MySQLconnector and Pandas. | 0.386912 | false | 2 | 5,893 |
2019-01-10 18:42:54.360 | Interfacing a QR code recognition to a django database | I'm coming to you with the following issue:
I have a bunch of physical boxes onto which I still stick QR codes generated using a python module named qrcode. In a nutshell, what I would like to do is everytime someone wants to take the object contained in a box, he scans the qr code with his phone, then takes it and put... | The question boils down to a few choices: (a) what data do you want to encode into the QR code; (b) what app will you use to scan the QR code; and (c) how do you want the app to use / respond to the encoded data.
If you want your users to use off-the-shelf QR code readers (like free smartphone apps), then encoding a fu... | 1.2 | true | 1 | 5,894 |
2019-01-11 08:09:37.980 | How can I read a file having different column for each rows? | my data looks like this.
0 199 1028 251 1449 847 1483 1314 23 1066 604 398 225 552 1512 1598
1 1214 910 631 422 503 183 887 342 794 590 392 874 1223 314 276 1411
2 1199 700 1717 450 1043 540 552 101 359 219 64 781 953
10 1707 1019 463 827 675 874 470 943 667 237 1440 892 677 631 425
How can I read this file structure i... | Use something like this to split it
split2=[]
split1=txt.split("\n")
for item in split1:
split2.append(item.split(" ")) | 0 | false | 1 | 5,895 |
2019-01-11 11:02:30.650 | How to align training and test set when using pandas `get_dummies` with `drop_first=True`? | I have a data set from telecom company having lots of categorical features. I used the pandas.get_dummies method to convert them into one hot encoded format with drop_first=True option. Now how can I use the predict function, test input data needs to be encoded in the same way, as the drop_first=True option also droppe... | When not using drop_first=True you have two options:
Perform the one-hot encoding before splitting the data in training and test set. (Or combine the data sets, perform the one-hot encoding, and split the data sets again).
Align the data sets after one-hot encoding: an inner join removes the features that are not pres... | 0.386912 | false | 1 | 5,896 |
2019-01-11 19:30:04.483 | Python anytree application challenges with my jupyter notebook | I am working in python 3.7.0 through a 5.6.0 jupyter notebook inside Anaconda Navigator 1.9.2 running in a windows 7 environment. It seems like I am assuming a lot of overhead, and from the jupyter notebook, python doesn’t see the anytree application module that I’ve installed. (Anytree is working fine with python from... | The core problem with my python IDE environment was that I could not utilize the functions in the anytree module. The anytree functions worked fine from the command prompt python, but I only saw error messages from any of the Anaconda IDE portals.
Solution:
1) From the windows start menu, I opened Anaconda Navigator, ... | 1.2 | true | 1 | 5,897 |
2019-01-12 03:01:39.153 | How do I get VS Code to recognize modules in virtual environment? | I set up a virtual environment in python 3.7.2 using "python -m venv foldername". I installed PIL in that folder. Importing PIL works from the terminal, but when I try to import it in VS code, I get an ImportError. Does anyone know how to get VS code to recognize that module?
I've tried switching interpreters, but the ... | I ended up changing the python.venvpath setting to a different folder, and then moving the virtual env folder(The one with my project in it) to that folder. After restarting VS code, it worked. | 0 | false | 1 | 5,898 |
2019-01-15 06:52:45.623 | Good resources for video processing in Python? | I am using the yolov3 model running on several surveillance cameras. Besides this I also run tensorflow models on these surveillaince streams. I feel a little lost when it comes to using anything but opencv for rtsp streaming.
So far I haven't seen people use anything but opencv in python. Are there any places I should... | Of course are the alternatives to OpenCV in python if it comes to video capture but in my experience none of them preformed better | 1.2 | true | 1 | 5,899 |
2019-01-15 06:54:00.607 | Automate File loading from s3 to snowflake | In s3 bucket daily new JSON files are dumping , i have to create solution which pick the latest file when it arrives PARSE the JSON and load it to Snowflake Datawarehouse. may someone please share your thoughts how can we achieve | There are some aspects to be considered such as is it a batch or streaming data , do you want retry loading the file in case there is wrong data or format or do you want to make it a generic process to be able to handle different file formats/ file types(csv/json) and stages.
In our case we have built a generic s3 to ... | 0 | false | 1 | 5,900 |
2019-01-15 20:16:34.613 | pythonnet clr is not recognized in jupyter notebook | I have installed pythonnet to use clr package for a specific API, which only works with clr in python. Although in my python script (using command or regular .py files) it works without any issues, in jupyter notebook, import clr gives this error, ModuleNotFoundError: No module named 'clr'. Any idea how to address this... | since you are intended to use clr in jupyter, in jupyter cell, you could also
!pip install pythonnet for the first time and every later time if the vm is frequently nuked | 0 | false | 2 | 5,901 |
2019-01-15 20:16:34.613 | pythonnet clr is not recognized in jupyter notebook | I have installed pythonnet to use clr package for a specific API, which only works with clr in python. Although in my python script (using command or regular .py files) it works without any issues, in jupyter notebook, import clr gives this error, ModuleNotFoundError: No module named 'clr'. Any idea how to address this... | Here is simple suggestion: compare sys.path in both cases and see the differences. Your ipython kernel in jupyter is probably searching in different directories than in normal python process. | 1.2 | true | 2 | 5,901 |
2019-01-15 20:47:18.657 | Tried importing Java 8 JDK for PySpark, but PySpark still won't let me start a session | Ok here's my basic information before I go on:
MacBook Pro: OS X 10.14.2
Python Version: 3.6.7
Java JDK: V8.u201
I'm trying to install the Apache Spark Python API (PySpark) on my computer. I did a conda installation: conda install -c conda-forge pyspark
It appeared that the module itself was properly downloaded because... | This problem is coming with spark 2.4. please try spark 2.3. | 0 | false | 1 | 5,902 |
2019-01-16 08:53:00.437 | Install python packages offline on server | I want to install some packages on the server which does not access to internet. so I have to take packages and send them to the server. But I do not know how can I install them. | Download the package from website and extract the tar ball.
run python setup.py install | -0.201295 | false | 1 | 5,903 |
2019-01-17 08:51:46.440 | Dask: delayed vs futures and task graph generation | I have a few basic questions on Dask:
Is it correct that I have to use Futures when I want to use dask for distributed computations (i.e. on a cluster)?
In that case, i.e. when working with futures, are task graphs still the way to reason about computations. If yes, how do I create them.
How can I generally, i.e. no m... | 1) Yup. If you're sending the data through a network, you have to have some way of asking the computer doing the computing for you how's that number-crunching coming along, and Futures represent more or less exactly that.
2) No. With Futures, you're executing the functions eagerly - spinning up the computations as soon... | 1.2 | true | 1 | 5,904 |
2019-01-19 00:00:55.483 | Python how to get labels of a generated adjacency matrix from networkx graph? | If i've an networkx graph from a python dataframe and i've generated the adjacency matrix from it.
So basically, how to get labels of that adjacency matrix ? | Assuming you refer to nodes' labels, networkx only keeps the the indices when extracting a graph's adjacency matrix. Networkx represents each node as an index, and you can add more attributes if you wish. All node's attributes except for the index are kept in a dictionary. When generating graph's adjacency matrix only ... | 1.2 | true | 2 | 5,905 |
2019-01-19 00:00:55.483 | Python how to get labels of a generated adjacency matrix from networkx graph? | If i've an networkx graph from a python dataframe and i've generated the adjacency matrix from it.
So basically, how to get labels of that adjacency matrix ? | If the adjacency matrix is generated without passing the nodeList, then you can call G.nodes to obtain the default NodeList, which should correspond to the rows of the adjacency matrix. | -0.201295 | false | 2 | 5,905 |
2019-01-20 12:48:34.697 | How to wait for some time between user inputs in tkinter? | I am making a GUI program where the user can draw on a canvas in Tkinter. What I want to do is that I want the user to be able to draw on the canvas and when the user releases the Mouse-1, the program should wait for 1 second and clear the canvas. If the user starts drawing within that 1 second, the canvas should stay ... | You can bind the mouse click event to a function that sets a bool to True or False, then using after to call a function after 1 second which depending on that bool clears the screen. | 1.2 | true | 1 | 5,906 |
2019-01-21 21:13:07.617 | Persistent Machine Learning | I have a super basic machine learning question. I've been working through various tutorials and online classes on machine learning and the various techniques to learning how to use it, but what I'm not seeing is the persistent application piece.
So, for example, I train a network to recognize what a garden gnome looks ... | Use python pickle library to dump your trained model on your hard drive and load model and test for persistent results. | 0 | false | 1 | 5,907 |
2019-01-21 23:31:10.607 | Is it possible to extract an SSRS report embedded in the body of an email and export to csv? | We currently are receiving reports via email (I believe they are SSRS reports) which are embedded in the email body rather than attached. The reports look like images or snapshots; however, when I copy and paste the "image" of a report into Excel, the column/row format is retained and it pastes into Excel perfectly, w... | The most efficient solution is to have the SSRS administrator (or you, if you have permissions) set the subscription to send as CSV. To change this in SSRS right click the report and then click manage. Select "Subscriptions" on the left and then click edit next to the subscription you want to change. Scroll down to Del... | 0 | false | 1 | 5,908 |
2019-01-22 05:44:57.673 | How to install sympy package in python | I am a beginner to python, I wanted to symbolic computations. I came to know with sympy installation into our pc we can do symbolic computation. I have installed python 3.6 and I am using anaconda nagavitor, through which I am using spyder as an editor. now I want to install symbolic package sympy how to do that.
I che... | To use conda install, open the Anaconda Prompt and enter the conda install sympy command.
Alternatively, navigate to the scripts sub-directory in the Anaconda directory, and run pip install sympy. | 0 | false | 2 | 5,909 |
2019-01-22 05:44:57.673 | How to install sympy package in python | I am a beginner to python, I wanted to symbolic computations. I came to know with sympy installation into our pc we can do symbolic computation. I have installed python 3.6 and I am using anaconda nagavitor, through which I am using spyder as an editor. now I want to install symbolic package sympy how to do that.
I che... | In anaconda navigator:
Click Environments (on the left)
Choose your environment (if you have more than one)
On the middle pick "All" from dropbox ("installed" by default)
Write sympy in search-box on the right
Check the package that showed out
Click apply | 0.135221 | false | 2 | 5,909 |
2019-01-22 18:26:43.977 | tkinter.root.destroy and cv2.imshow - X Windows system error | I found this rather annoying bug and I couldn’t find anything other than a unanswered question on the opencv website, hopefully someone with more knowledge about the two libraries will be able to point me in the right direction.
I won’t provide code because that would be beside the point of learning what causes the cra... | When you destroy the root window, it destroys all children windows as well. If cv2 uses a tkinter window or child window of the root window, it will fail if you destroy the root window. | 0 | false | 1 | 5,910 |
2019-01-22 23:09:52.430 | How do I use Pyinstaller to make a Mac file on Windows? | I am on Windows and I am trying to figure how to use Pyinstaller to make a file (on Windows) for a Mac.
I have no trouble with Windows I am just not sure how I would make a file for another OS on it.
What I tried in cmd was: pyinstaller -F myfile.py and I am not sure what to change to make a Mac compatible file. | Not Possible without using a Virtual Machine | 0 | false | 1 | 5,911 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.