Closed mwaskom closed 5 years ago
Hi @mwaskom Any update on this? It's a blocking error. I'm not quite sure your diagnosis is correct, because the "planets" example still works, and the categorical there is an object too. Could it be a data size thing?
Actually resolved this temporarily (by not naming pandas columns??) but I don't know what's going on.
Just change the dtype of the column...
(Title was incorrect, the issue is with the dtype of the numeric/quantitative variable, which is clear from the example).
I was constructing a DataFrame
and the column of y value was created as object
dtype. I got the same error. After I changed the dtype by pd.to_numeric
, the error disappeared.
Trying to reproduce with the following code:
import seaborn as sns
import numpy as np
tips = sns.load_dataset("tips")
tips["tip"] = tips.tip.astype(np.object)
sns.swarmplot(x="day", y="tip", data=tips)
And it works on my machine using seaborn 0.9.0. Perhaps not an issue anymore? Other packages used: numpy 1.16.2, pandas 0.23.0 and matplotlib 3.0.3 (all installed through conda with python 3.6.8 on linux).
Can confirm that the initial example works fine for me now, and not even with latest versions of libraries (matplotlib 2.2 and numpy 1.15), so will close.
Not sure exactly, but an internal cast should avoid it...