Skip to content

Commit

Permalink
TST: Remove np.core usage (#55565)
Browse files Browse the repository at this point in the history
  • Loading branch information
mroeschke authored Oct 17, 2023
1 parent b2a622e commit 910fa77
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pandas/tests/frame/constructors/test_from_records.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,15 @@ def test_from_records_with_datetimes(self):
arrdata = [np.array([datetime(2005, 3, 1, 0, 0), None])]
dtypes = [("EXPIRY", "<M8[ns]")]

recarray = np.core.records.fromarrays(arrdata, dtype=dtypes)
recarray = np.rec.fromarrays(arrdata, dtype=dtypes)

result = DataFrame.from_records(recarray)
tm.assert_frame_equal(result, expected)

# coercion should work too
arrdata = [np.array([datetime(2005, 3, 1, 0, 0), None])]
dtypes = [("EXPIRY", "<M8[m]")]
recarray = np.core.records.fromarrays(arrdata, dtype=dtypes)
recarray = np.rec.fromarrays(arrdata, dtype=dtypes)
result = DataFrame.from_records(recarray)
# we get the closest supported unit, "s"
expected["EXPIRY"] = expected["EXPIRY"].astype("M8[s]")
Expand Down

0 comments on commit 910fa77

Please sign in to comment.