Das Festlegen eines inkompatiblen DTY -Elements ist veraltet und wird in einem zukünftigen Fehler von Pandas erhöhtPython

Python-Programme
Guest
 Das Festlegen eines inkompatiblen DTY -Elements ist veraltet und wird in einem zukünftigen Fehler von Pandas erhöht

Post by Guest »

Ich habe den folgenden Code, der beispielsweise als ausgenommen funktioniert, aber in Zukunft nicht funktioniert: < /p>

Code: Select all

total.name = 'New_Row'
total_df = total.to_frame().T
total_df.at['New_Row', 'CURRENCY'] = ''
total_df.at['New_Row', 'MANDATE'] = Portfolio
total_df.at['New_Row', 'COMPOSITE'] = 'GRAND TOTAL'
total_df.set_index('COMPOSITE',inplace=True)
< /code>
Da ein Fehler in < /p>
geworfen wirdFutureWarning: Setting an item of incompatible dtype is deprecated and
will raise in a future error of pandas. Value 'GRAND TOTAL' has dtype incompatible with float64, please explicitly cast to a compatible dtype first.
total_df.at['New_Row', 'COMPOSITE'] = 'GRAND TOTAL'
< /code>
So beheben Sie dies?CURRENCY
MANDATE             Mandate_Test
USD AMOUNT          123
LOCAL AMOUNT        12
Beg. Mkt            123
End. Mkt            456
Name: New_Row, dtype: object

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post