Ciao a tutti.
dopo aver fatto calcolo correlazione e stazionarietà ho eliminato i dati ridondanti ed elevatamente correalti con la funzione sotto:
X=data.drop(columns=['Open','Close','High','Low','rsi','Adj Close'],axis=1,inplace=True)
perchè se utilizzo la funzione come da corso (vedi sotto) non effettua l'eliminazione e segnala errore
X=X.drop(columns=['Open','Close','High','Low','rsi','Adj Close'],axis=1,inplace=True)].
nella verifica della conferma richiamando la funzione
list(X.columns)
ho questo errore: AttributeError: 'NoneType' object has no attribute 'columns'
se utilizzo
list(data.columns)
è ok.
Vorrei sapere prima di andare avanti, richiamando nelle funzioni sopra "data" anzichè "X" posso essere sicura che in X features i dati salvati sono quelli depurati di cio' che devo eliminare?
Grazie, ma preferisco essere sicura.
Hello Irene,
Could you please let us know which course, section and unit you're referring to?
Thanks!
José Carlos
Hi Irene,
This error is because X is an empty dataframe.
So basically when you are executing the first line:
X=data.drop(columns=['Open','Close','High','Low','rsi','Adj Close'],axis=1,inplace=True)
This statement drops the corresponding columns from data and assigns it to X. So does your original dataframe data contain only these columns(columns=['Open', 'Close', 'High', 'Low', 'rsi', 'Adj Close'])?
If yes then dropping all of these and assigning the remaining dataframe to X would basically assign an empty dataframe. When you are doing list(data.columns) this is giving an output because the original dataframe data still contains these columns.
If not then it would be great if you can share the code so that we can debug it further.
Hope that helps!
Thanks,
Akshay