Warning since use of new environment

Below is an easy example of the problem. This used to work perfectly in the past but since I started working in a new environment, I get the error message below

โ€˜โ€™โ€™
import pandas as pd
import numpy as np
import plotly.express as px

Define the data for each column

dates = pd.date_range(โ€˜2024-01-01โ€™, periods=10)
col1 = np.random.randint(1, 100, size=10) # Random integers between 1 and 100 for col1
col2 = np.random.randint(1, 100, size=10) # Random integers between 1 and 100 for col2
col3 = np.random.randint(1, 100, size=10) # Random integers between 1 and 100 for col3
col4 = np.random.randint(1, 100, size=10) # Random integers between 1 and 100 for col4
col5 = np.random.randint(1, 100, size=10) # Random integers between 1 and 100 for col5

Create the DataFrame

data = {โ€˜datumโ€™: dates, โ€˜col1โ€™: col1, โ€˜col2โ€™: col2, โ€˜col3โ€™: col3, โ€˜col4โ€™: col4, โ€˜col5โ€™: col5}
df = pd.DataFrame(data)

Display the DataFrame

print(df)
list = [โ€˜col1โ€™,โ€˜col5โ€™]
fig = px.bar(df, x=df.index, y=list,barmode=โ€˜groupโ€™)
fig.show()
โ€˜โ€™โ€™
#warning: When grouping with a length-1 list-like, you will need to pass a length-1 tuple to get_group in a future version of pandas. Pass (name,) instead of name to silence this warning.

This warning seems to have appeared in pandas 2.2. It doesnโ€™t turn up with pandas 2.1.3. I donโ€™t know if thereโ€™s any way to get rid of it by changing your call to px.bar().

Is it a pandas bug ?

I think itโ€™s the issue discussed at the link below. Not a Pandas bug, but a change in Pandas that required a change to be made in Plotly. I think it is all sorted now - do you still see this warning with Plotly 5.20?

"I did a test on another desktop. I now have no error message but also no graph.

The code you posted in your OP seems to be working fine for me:

plotly 5.20.0
pandas 2.2.2
jupyterlab 4.0.9

Iโ€™m wondering if having both โ€˜print()โ€™ and โ€˜fig.show()โ€™ in the same cell could be an issue in some environments, but otherwise you may need to give more details if youโ€™re still having problems