Skip to content

Commit

Permalink
style: fixed pandas deprecation errors for frequency strings
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkusPic committed Apr 16, 2024
1 parent 10e2f2e commit b6f2a51
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion ehyd_tools/data_processing.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def data_validation(series):

tags = DataFrame(index=ts.index)
tags['nans'] = isna(ts).astype(int)
tags = tags.reindex(tags.asfreq('T').index)
tags = tags.reindex(tags.asfreq('min').index)
tags['gaps'] = isna(ts.fillna(0).reindex(tags.index)).astype(int)
return tags

Expand Down
4 changes: 2 additions & 2 deletions ehyd_tools/design_rainfall.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def table(self):
# df = df.dropna(axis=0, how='all')

# convert string column names to integers
df.columns = df.columns.str.replace('T', '').astype(int)
df.columns = df.columns.str.replace('min', '').astype(int)
# df.columns.name = 'Jährlichkeit'
df.columns.name = INDICES.RETURN_PERIOD

Expand Down Expand Up @@ -217,7 +217,7 @@ def read_ehyd_design_rainfall(filepath_or_buffer):
df = df.dropna(axis=0, how='all')

# convert string column names to integers
df.columns = [int(c.replace('T', '')) for c in df.columns]
df.columns = [int(c.replace('min', '')) for c in df.columns]
# df.columns.name = 'Jährlichkeit'
df.columns.name = INDICES.RETURN_PERIOD

Expand Down
2 changes: 1 addition & 1 deletion ehyd_tools/in_out.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ def import_series(filename, series_label='precipitation', index_label='datetime'
return read_ehyd_file(filename)
elif filename.endswith('parquet'):
try:
return pd.read_parquet(filename).iloc[:, 0].asfreq('T').copy()
return pd.read_parquet(filename).iloc[:, 0].asfreq('min').copy()
except ImportError:
raise PARQUET_ERROR
else:
Expand Down

0 comments on commit b6f2a51

Please sign in to comment.