mwaskom / seaborn

Statistical data visualization in Python
https://seaborn.pydata.org
BSD 3-Clause "New" or "Revised" License
12.63k stars 1.93k forks source link

countplot taking long time for Series and not Pandas #3654

Closed sarath-mec closed 8 months ago

sarath-mec commented 8 months ago

In my Jupyter Notebook and Google Colab running version 13.2 Latest, I noticed that the countplot is going in a ever ending loop

import pandas as pd
from tensorflow.keras.datasets import mnist
(X_train, y_train), (X_test, y_test) = mnist.load_data()

pd.Series(y_train).value_counts() # Results immediate

sns.countplot(pd.Series(y_train)) # Takes Forever for Series

sns.countplot(pd.Series(y_train, name='no').to_frame(), x='no', hue='no')  #Completes fast when in Pandas DataFrame
mwaskom commented 8 months ago

If you're passing a series you want to assign it to x= or y=.