Python: Pandas inplace=True deprecated

Aperta Adatta ai principianti
#2,802 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
82/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
pandas, python
Ambito
data

Direzione di ricerca

Inizia leggendo le sei posizioni segnalate in python/prophet/forecaster.py, python/prophet/make_holidays.py e python/prophet/metrics.py, quindi verifica come viene utilizzato il risultato di ciascun metodo DataFrame. Sostituisci le chiamate deprecate con inplace=True con risultati assegnati ed esegui i test Python pertinenti per confermare che passino senza gli avvisi di deprecazione.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

The use of inplace=True in Pandas DataFrame method's is being deprecated, already start causing warnings.

pandas.errors.Pandas4Warning: The inplace keyword in DataFrame.drop is deprecated and will be removed in a future version (PDEP-8).
See https://pandas.pydata.org/docs/dev/whatsnew/v3.1.0.html#deprecation-inplace for more details.

The following are the affected lines that I could find at first glance on the main branch. In all cases, the inplace-writing of dataframes is not necessary and can be replaced by df = df.some_method() without the inplace argument.

https://github.com/meta/prophet/blob/573a00da313d2e73c15ffe0cb4e04ec5f35b4b91/python/prophet/forecaster.py#L608

https://github.com/meta/prophet/blob/573a00da313d2e73c15ffe0cb4e04ec5f35b4b91/python/prophet/forecaster.py#L627

https://github.com/meta/prophet/blob/573a00da313d2e73c15ffe0cb4e04ec5f35b4b91/python/prophet/forecaster.py#L1105

https://github.com/meta/prophet/blob/573a00da313d2e73c15ffe0cb4e04ec5f35b4b91/python/prophet/make_holidays.py#L78

https://github.com/meta/prophet/blob/573a00da313d2e73c15ffe0cb4e04ec5f35b4b91/python/prophet/metrics.py#L113

https://github.com/meta/prophet/blob/573a00da313d2e73c15ffe0cb4e04ec5f35b4b91/python/prophet/metrics.py#L284

Lingua principale
Python
Stelle
20.5k
Fork
4.6k
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di facebook/prophet

Tutte le issue di facebook/prophet

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.