We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hello, I'm trying to run file 01_machine_learning_workflow. But when execute this code:
correl = (X .apply(lambda x: spearmanr(x, y)) .apply(pd.Series, index=['r', 'pval'])) correl.r.sort_values().plot.barh();
I got this error:
--------------------------------------------------------------------------- AttributeError Traceback (most recent call last) /var/folders/lm/wvh4bt6d1jxfppzrzx123szh0000gp/T/ipykernel_7138/2418974112.py in <module> 3 .apply(pd.Series, index=['r', 'pval'])) 4 ----> 5 correl.r.sort_values().plot.barh(); ~/opt/anaconda3/envs/quant/lib/python3.8/site-packages/pandas/core/generic.py in __getattr__(self, name) 5485 ): 5486 return self[name] -> 5487 return object.__getattribute__(self, name) 5488 5489 def __setattr__(self, name: str, value) -> None: AttributeError: 'DataFrame' object has no attribute 'r'
How can I resolve this issue and where is r and pval from?
r
pval
Thanks for advance!
The text was updated successfully, but these errors were encountered:
The dataframe should be transpose first:
correl = (X .apply(lambda x: spearmanr(x, y)) .apply(pd.Series) ).transpose() correl = correl.rename(columns={0: "r", 1: "pval"}) correl
Sorry, something went wrong.
Please refer to this repository.
No branches or pull requests
Hello,
I'm trying to run file 01_machine_learning_workflow. But when execute this code:
I got this error:
How can I resolve this issue and where is
r
andpval
from?Thanks for advance!
The text was updated successfully, but these errors were encountered: