pandas_dataframe_to_unit_arrays

metpy.units.pandas_dataframe_to_unit_arrays(df, column_units=None)[source]

Attach units to data in pandas dataframes and return united arrays.

Parameters:
  • df (pandas.DataFrame) – Data in pandas dataframe.
  • column_units (dict) – Dictionary of units to attach to columns of the dataframe. Overrides the units attribute if it is attached to the dataframe.
Returns:

  • Dictionary containing united arrays with keys corresponding to the dataframe
  • column names.