I’ve been able to get this to execute once but since then the kernel just hangs and then dies. Any help would be appreciated. [Dataframe head] Answer You might want to consider using .apply() function from pandas directly with a custom function or a lambda expression. Something like this I do not see an…
Tag: jupyter-notebook
How to compare a list of routes with a dictionary of costs between arcs?
Hello to the whole community, I have a question about creating an automatic method (function or loop+) to declare a route cost variable, which involves the sum of each of the c_i,j arcs. Example: I would like to get help to reach a RouteCost variable that compares the list with the dictionary and will add eac…
Pandas on Jupyter Notebook VS Code not displaying outputs properly
Does anyone know how to make Pandas outputs display properly in VS Code Jupyter Notebooks? As you can see in the image, the values for individual columns in the output of a Pandas DataFrame aren’t aligned (whereas they are aligned if you use Jupyter Notebooks directly on a web browser). Answer For the a…
How to find and replace text in a single cell when using Jupyter extension inside Visual Studio Code
As the title says, how to find and replace text inside a single jupyter cell when using the jupyter extension in Visual Studio Code? I am familiar with ctr+h but that will replace all the occurrences in the entire jupyter notebook file. This is a really important feature for me, as I am using it a lot in jupy…
How to highlight the column in Pandas Dataframe with MultiIndex / advanced indexing by the condition
Could you, please, help me with highlighting the columns in my dataframe with multiindex/advanced indexing? I have the code which forms the Table 1: So, (2022-02-27, ‘Разница в процентах’), (2022-02-26, ‘Разница в процентах’), etc. are columns in this table in python and ‘Источни…
(Tensorflow) Stuck at Epoch 1 during model.fit()
I’ve been trying to make Tensorflow 2.8.0 work with my Windows GPU (GeForce GTX 1650 Ti), and even though it detects my GPU, any model that I make will be stuck at Epoch 1 indefinitely when I try to use the fit method till the kernel (I’ve tried on jupyter notebook and spyder) hangs and restarts. …
Why is pd.to_datetime() only changing type if utc is True?
After loading my csv file into my notebook in VS Code i wanted to change the columns type from object to datetime for some columns. So i did the following: object values of columns These are example values in the columns. check convert check After converting the columns i wanted to check if everything worked …
Jupyter notebook cannot find module
I’m trying to load a module called folium into my Jupyter Notebook environment. When I attempt to load this module, a ModuleNotFoundError is returned. When I run !pip list in the same Jupyter Notebook environment, folium is listed amongst my installed modules. How do I successfully load this module? Ans…
AzureML Environment for Inference : can’t add pip packages to dependencies
I can’t find the proper way to add dependencies to my Azure Container Instance for ML Inference. I basically started by following this tutorial : Train and deploy an image classification model with an example Jupyter Notebook It works fine. Now I want to deploy my trained TensorFlow model for inference.…
Make dictionary from multiple list
I have a list of customers, and I want to generate a list of random numbers between 1 to 4 for each customer. I used the code below: but I want to have a dictionary like: How would I go about doing this in python? Answer Slight modifications to your existing loop is all you need. You can use your