Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
sbenthall committed Jun 3, 2024
1 parent ed1e988 commit 42568c2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bigbang/analysis/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def get_index_of_msgs_with_datetime(
cond = lambda x: (
True
if (isinstance(x, str) and (len(x) > 10))
or isinstance(x, datetime.datetime)
or isinstance(x, datetime)
and not pd.isna(x)
else False
)
Expand Down Expand Up @@ -119,7 +119,7 @@ def clean_datetime(df: pd.DataFrame) -> pd.DataFrame:
index = get_index_of_msgs_with_datetime(df)
# convert data type from string to datetime.datetime object
df.loc[index, "date"] = [
datetime.datetime.strptime(dt, "%a, %d %b %Y %H:%M:%S %z")
datetime.strptime(dt, "%a, %d %b %Y %H:%M:%S %z")
for dt in df.loc[index, "date"].values
]
return df
Expand Down

0 comments on commit 42568c2

Please sign in to comment.