Skip to content

Commit

Permalink
Fix Py34: Iterate over datetimes
Browse files Browse the repository at this point in the history
The old pandas versions available for Py34 cannot subtract timedeltas
from ndarrays. Subtracting them individually works and was used in the
fix for later pandas versions:
pandas-dev/pandas#22054
  • Loading branch information
st-bender committed Jul 3, 2020
1 parent deca62a commit 57a08c8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/nrlmsise00/dataset/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ def msise_4d(
sw = sw_daily()
# convert arbitrary shapes
dts = np.vectorize(pd.to_datetime)(time, utc=True)
dtps = dts - pd.to_timedelta("1d")
dtps = np.array([dt - pd.to_timedelta("1d") for dt in dts])

ap = _check_gm(ap, dts, df=sw[["Apavg"]])
f107 = _check_gm(f107, dtps, df=sw[["f107_obs"]])
Expand Down

0 comments on commit 57a08c8

Please sign in to comment.