Skip to content

Commit 4ff226b

Browse files
authored
Merge pull request dClimate#85 from dClimate/ibtracs_unit_column_modification
modified storm retrieval to allow for units column
2 parents c90ea2a + 7dcb684 commit 4ff226b

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

dweather_client/storms_datasets.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,20 @@ def get_data(self, basin, **kwargs):
3131
df = pd.read_csv(
3232
file_obj, na_values=["", " "], keep_default_na=False, low_memory=False, compression="gzip"
3333
)
34+
direction_row = df[0:1] # We remove the direction row when doing manipulations of the data
3435
df = df[1:]
36+
direction_row["lat"] = direction_row["LAT"]
37+
direction_row["lon"] = direction_row["LON"]
38+
del direction_row["LAT"]
39+
del direction_row["LON"]
40+
3541
df["lat"] = df.LAT.astype(float)
3642
df["lon"] = df.LON.astype(float)
3743
del df["LAT"]
3844
del df["LON"]
39-
45+
4046
processed_df = process_df(df, **kwargs)
41-
47+
processed_df = pd.concat([direction_row, processed_df]).reset_index(drop = True)
4248
processed_df["HOUR"] = pd.to_datetime(processed_df["ISO_TIME"])
4349
del processed_df["ISO_TIME"]
4450

0 commit comments

Comments
 (0)