Skip to content

Commit 57a08c8

Browse files
committed
Fix Py34: Iterate over datetimes
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
1 parent deca62a commit 57a08c8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/nrlmsise00/dataset/core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ def msise_4d(
233233
sw = sw_daily()
234234
# convert arbitrary shapes
235235
dts = np.vectorize(pd.to_datetime)(time, utc=True)
236-
dtps = dts - pd.to_timedelta("1d")
236+
dtps = np.array([dt - pd.to_timedelta("1d") for dt in dts])
237237

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

0 commit comments

Comments
 (0)