Skip to content
Advertisement

Tag: jupyter-notebook

Kernel dies when processing DataFrame

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 any conversion to float. I suspect that

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 ‘Источник’ is an index. I want to highlight the columns, where the values >= 15, and make it

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? Answer Could it be that you expect a certain Python installation

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

Advertisement