Dfs0
Class for reading/writing dfs0 files.
Methods
from_dataframe |
Create a dfs0 from a pandas Dataframe. |
read |
Read data from a dfs0 file. |
to_dataframe |
Read data from the dfs0 file and return a Pandas DataFrame. |
from_dataframe
Dfs0.from_dataframe(df, filename, itemtype=None, unit=None, items=None)
Create a dfs0 from a pandas Dataframe.
Parameters
df |
pd.DataFrame |
Dataframe with data |
required |
filename |
str |
filename to write output |
required |
itemtype |
EUMType | None |
Same type for all items |
None |
unit |
EUMUnit | None |
Same unit for all items |
None |
items |
Sequence[ItemInfo] | None |
Different types, units for each items |
None |
read
Dfs0.read(items=None, time=None, **kwargs)
Read data from a dfs0 file.
Parameters
items |
str | int | Sequence[str | int] | None |
Read only selected items, by number (0-based), or by name |
None |
time |
int | str | slice | None |
Read only selected time steps, by default None (=all) |
None |
**kwargs |
Any |
Additional keyword arguments are ignored |
{} |
Returns
|
Dataset |
A Dataset with data dimensions [t] |
to_dataframe
Dfs0.to_dataframe(unit_in_name=False, round_time='ms')
Read data from the dfs0 file and return a Pandas DataFrame.
Parameters
unit_in_name |
bool |
include unit in column name, default False |
False |
round_time |
str |
round time to avoid problem with floating point inaccurcy, set to False to avoid rounding |
'ms' |