1

I run the following code, and get the following error:

import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
import pandas as pd

wines = pd.read_csv('Wine.csv')


plt.scatter(wines['alcohol'],wines['hue'],c=wines['class'])
plt.xlabel('alcohol')
plt.ylabel('hue')

plt.show()

And get the following error:

FutureWarning: elementwise comparison failed; returning scalar instead, but in the future will perform elementwise comparison if self._edgecolors == str('face'):

The graph still shows up, no problem...I'm not sure what is going on. Just updated my version of numpy, pandas, and matplotlib to the latest version available through anaconda...

How do I get rid of this error? I am not even aware that I am doing any elementwise comparisons...

Chris
  • 28,822
  • 27
  • 83
  • 158

1 Answers1

1

This is not an error. It is simply a warning, letting you know that the functionality of some function that was called will change in the future. In future versions of the library, it will return an array (or numpy Series, or dataframe) instead of a single value (it will perform elementwise operations).

It seems like something internal to the scatter() function as opposed to something you called up directly, so perhaps you could bring this to the attention of the developers of matplotlib on their website/github (assuming they are not already aware of it)

ronrest
  • 1,192
  • 10
  • 17
  • ...yeah, i ran into some stuff on google to this effect, but their fix was to update the versions. I figured since I updated, I'd give stack a try. This is a homework assignment, and I'm doing it on the Jupyter notebook, so the warning shows up in my notebook when I run...was just hoping to fix it/quiet it somehow... – Chris Jan 22 '16 at 01:27
  • this post might be useful for you then http://stackoverflow.com/a/9031848/4285679 – ronrest Jan 22 '16 at 01:31