Skip to content

FutureWarning triggered by units row in Dataframe #8

@bartvstratum

Description

@bartvstratum

It is nice to have the units in the second row of the .csv, but adding a row with strings to a Dataframe with numerical values results in a FutureWarning:

/home/bart/meteo/maq_observations/post-processing/fetch_data.py:94: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise an error in a future version of pandas. Value 'W m-2' has dtype incompatible with float64, please explicitly cast to a compatible dtype first.
final_df_pivoted.loc[0] = units_row

So this will likely break in future versions. Unfortunately, the only solution I can think of is to add the extra row with units outside of Pandas....

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions