You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
importpandasaspdfromscipy.statsimportpearsonrdf=pd.DataFrame({'A': [1,2,3], 'B': [2,5,6]})
df.corr(method='a')
---------------------------------------------------------------------------ValueErrorTraceback (mostrecentcalllast)
<ipython-input-19-be8a09a85708>in<module>23df=pd.DataFrame({'A': [1,2,3], 'B': [2,5,6]})
---->4df.corr(method='a')
~/miniconda3/envs/spols190117/lib/python3.6/site-packages/pandas/core/frame.pyincorr(self, method, min_periods)
7034raiseValueError("method must be either 'pearson', "7035"'spearman', or 'kendall', '{method}' "->7036"was supplied".format(method=method))
70377038returnself._constructor(correl, index=idx, columns=cols)
ValueError: methodmustbeeither'pearson', 'spearman', or'kendall', 'a'wassupplied
Problem description
The ValueError in the example above does not mention that a callable could be supplied to corr as well. I would suggest to add this to the error message.
Code Sample, a copy-pastable example if possible
Problem description
The
ValueError
in the example above does not mention that acallable
could be supplied tocorr
as well. I would suggest to add this to the error message.Expected Output
Output of
pd.show_versions()
The text was updated successfully, but these errors were encountered: