When I change/add a variable to my config.py file and then try to import it to my Jupyter Notebook I get: ImportError: cannot import name ‘example_var’ from ‘config’ config.py: jp_notebook.ipynb: But after I restart the Jupyter Kernel it works fine until I modify the config.py file again. I read somewhere that it’s because jupyter already cached that import. Is there
Tag: jupyter-notebook
Sharing Y-axis in a matplotlib subplots
I have been trying to create a matplotlib subplot (1 x 3) with horizontal bar plots on either side of a lineplot. It looks like this: The code for generating the above plot – Edit How do I share the y-axis of the central line plot with the other horizontal bar plots? Answer I would set the limits of all
My Python Output Repeats Itself Hundreds of Time
I am learning to scrape data from a website. I have a problem when printing my code using jupyter notebook. My output repeats itself many times and I don’t know how to fix it. Here’s my trial code: I thought it was fine until I print it out: And hundreds more…. All answers are so much appreciated. Thanks! Answer The
Python filter from Excel
I am working on to create a python automation program for Excel. I wanted to divide the longitude based on the median number. What I want to get data is : Below is my code: Below is the output from this code. output above the output is show all longitude in United States. However, I want to filter only 1.
How to know torch version that installed locally in your device
I want to check torch version in my device using Jupyter Notebook. I’m used this but it didn’t work and Jupyter notebook raised an error as below Is there any command to check torch version using Jupyter notebook? Answer I have tried to install new Pytorch version. But, it didn’t work and then I deleted the Pytorch files manually suggested
Python: how can I change amount_sold and price_per_unit from string to int
I want to change amount_sold and price_per_unit from string to int but its error. After I zipped the data, each attribute becomes a tuple. Then, I try to change to list by using this code (list(amount_sold)) but it resulting in an error Answer I’m not sure if I’ve got this right because you don’t explain what line_list is. However, it
Python folium colormap format
I would like to add scientific notation to my LinearColormap folium map defined by to avoid unreadable scale inside my jupyter notebook: Is there a way to modify the tick scale formatter ? Answer … and after a huge struggling here the piece of my code !
problem with csv file to open it with csv.reader
I have the following code: But it errors: When I change ‘rb’ to ‘rt’: It says: And when I delete .astype(‘float’), the result is (769, 9) but the expected result is (768, 9). It counts the header as data. Can you tell me why? Answer Before you do following: try which should skip the header of csvfiles. It is described
AWS SageMaker Deployment for Batch Transform
I am trying to use a XGBoost model in Sage Maker and use it to score for a large data stored in S3 using Batch Transform. I build the model using existing Sagemaker Container as follows: The following code is used to do Batch Transform The above code works fine in Development environment (Jupyter notebook) when the model is built
Failed to use screen or nohup to keep Jupyter Notebook running in the background
I am doing machine learning on the company’s server I usually start the Jupyter notebook on my laptop, using the command jupyter-notebook –ip=192.168.1.200 –no-browser –port=999 in Xshell command line. Then copy the URL link to a browser. This time the ML is going to take up a lot of time, so I wish to run the training over the weekend.