Skip to content

Commit

Permalink
avoid warnings due to temporary pandas function futurewarning
Browse files Browse the repository at this point in the history
  • Loading branch information
Fedor Baart committed Mar 21, 2024
1 parent ef9e3c3 commit 92411c2
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/openclsim/core/log.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,12 @@ def log(self):
df[key] = df[key].astype(val)

# ensure we keep python datetimes and not timestamps. Timestamps will be cast to ints at the next step
df["Timestamp"] = pd.Series(df["Timestamp"].dt.to_pydatetime(), dtype=object)
# no way to do this without a loop or warnings at the moment
datetimes = pd.Series(
[x.to_pydatetime() for x in df["Timestamp"].tolist()], dtype=object
)

df["Timestamp"] = datetimes

# Convert table to this format:
# {'a': [1, 2], 'b': [2, 4]}
Expand Down

0 comments on commit 92411c2

Please sign in to comment.