I am thrown an error when I am trying to apply searbor pairplot. My full script is easy, and is copied as follows:
import seaborn as sns
import pandas as pd
import numpy as np
# Creating a sample DataFrame
data = {
'A': np.random.randn(100),
'B': np.random.randn(100),
'C': np.random.randn(100),
'D': np.random.randn(100)
}
df = pd.DataFrame(data)
# Create a pair plot
sns.pairplot(df)
But I am thrown this error:
---------------------------------------------------------------------------
OptionError Traceback (most recent call last)
Cell In[26], line 15
12 df = pd.DataFrame(data)
14 # Create a pair plot
---> 15 sns.pairplot(df)
File ~/miniforge3/envs/marketing/lib/python3.9/site-packages/seaborn/_decorators.py:46, in _deprecate_positional_args..inner_f(*args, **kwargs)
36 warnings.warn(
37 "Pass the following variable{} as {}keyword arg{}: {}. "
38 "From version 0.12, the only valid positional argument "
(...)
43 FutureWarning
44 )
45 kwargs.update({k: arg for k, arg in zip(sig.parameters, args)})
---> 46 return f(**kwargs)
File ~/miniforge3/envs/marketing/lib/python3.9/site-packages/seaborn/axisgrid.py:2126, in pairplot(data, hue, hue_order, palette, vars, x_vars, y_vars, kind, diag_kind, markers, height, aspect, corner, dropna, plot_kws, diag_kws, grid_kws, size)
2124 diag_kws.setdefault("legend", False)
2125 if diag_kind == "hist":
-> 2126 grid.map_diag(histplot, **diag_kws)
2127 elif diag_kind == "kde":
2128 diag_kws.setdefault("fill", True)
File ~/miniforge3/envs/marketing/lib/python3.9/site-packages/seaborn/axisgrid.py:1478, in PairGrid.map_diag(self, func, **kwargs)
...
--> 121 raise OptionError(f"No such keys(s): {repr(pat)}")
122 if len(keys) > 1:
123 raise OptionError("Pattern matched multiple keys")
OptionError: "No such keys(s): 'mode.use_inf_as_null'"
I have tried removing Seaborn, and reinstalled again with the conda command, but the error is the same.
Have anyone encountered this error before?
print(sns.__version__)
)? If I run your code with v0.12.2, I don't see any error. – Lloveraconda remove
, thenconda install
. But the old version 0.11.2 was so sturdy and stayed no matter what. I then triedconda install seaborn=v0.12.2
, and=v0.12'
but both gave me an errorPackagesNotFoundError: The following packages are not available from current channels
. I am guessing maybe because mine is a M1 Mac? – Slapdashconda install -c conda-forge seaborn=0.12.2
. I've tried on an M1 Mac and that seems to work for me. – Lloveraminiforge3
as opposed to a full version of anaconda, so maybe something go updated and caused a conflict. I'd tryconda update --all
. Optionally, create a new environment as shown in conda.io/projects/conda/en/latest/user-guide/tasks/… – Lamoreauxconda install -c conda-forge seaborn=0.12.2
solved my problem! conda-forge channel does the magic. – Slapdash