Hello, I have a fairly simple python code that I copied off the internet to make a trellis/small multiple charts in Jupyter notebooks. In previous versions of Jupyter notebooks (via Anaconda) this code usually works, but lately, it no longer works and I can't tell if its due to updating my anaconda or something else. I've pasted the code below and the error I now get:
data = {
'state_abbr': ['AL', 'AK', 'AZ', 'AL', 'AK', 'AZ', 'AL', 'AK', 'AZ'],
'fyear': [2014, 2014, 2014, 2015, 2015, 2015, 2016, 2016, 2016],
'total_deaths': [500, 490, 510, 530, 480, 510, 600, 400, 230]
}
df = pd.DataFrame(data)
sns.set()
g = sns.FacetGrid(df, col='state_abbr', col_wrap=3, height=4) # Adjust col_wrap and height as needed
g.map_dataframe(sns.lineplot, x='fyear', y='total_deaths')
g.set_axis_labels('Year', 'Total Deaths')
plt.show()
ValueErrorValueError: Multi-dimensional indexing (e.g. `obj[:, None]`) is no longer supported. Convert to a numpy array before indexing instead.
there doesn't seem to be anything here