Jupyter Notebook error when graphing with Seaborn


#1

I’m massively behind schedule and I’m trying to finish my capstone project for my Data Visualization with Python course.

The Slack workspace seems to be dead, so I’ll post my problem here instead.

When I try and run any Seaborn graph whatsoever in a Jupyter Notebook, I get the following error message:

“C:\Users\ffion\Miniconda3\lib\site-packages\scipy\stats\stats.py:1713: FutureWarning: Using a non-tuple sequence for multidimensional indexing is deprecated; use arr[tuple(seq)] instead of arr[seq]. In the future this will be interpreted as an array index, arr[np.array(seq)], which will result either in an error or a different result.
return np.add.reduce(sorted[indexer] * weights, axis=axis) / sumval”

If I go onto one of the solution Notebooks provided for some of the projects and run the model code there I get exactly the same error message, so I’m not sure there is actually a problem with the code I’ve written.

Why is this happening?

I don’t understand what the error message even means


#2

Hello @filippaberio,

When you get such warning, it is mostly because the Python version being used has some function/methods that are getting changed (deprectation) in next version.

Based on that, you can see that the error message suggest:

FutureWarning: Using a non-tuple sequence for multidimensional indexing is deprecated; use arr[tuple(seq)] instead of arr[seq]. In the future this will be interpreted as an array index, arr[np.array(seq)], which will result either in an error or a different result.

So you should use arr[tuple(seq)] instead of arr(seq) so you code doesn’t have problem running any future version of SciPy package.

Also, based on that line of code, I am pretty sure you following this tutorial.

Since it is a recent warning, I had to look to StackOverflow and found a good example about it: future warning example.

Cheers!