MCPcopy Create free account
hub / github.com/dask/dask / test_to_timestamp

Function test_to_timestamp

dask/dataframe/tests/test_dataframe.py:2757–2776  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2755
2756
2757def test_to_timestamp():
2758 index = pd.period_range(freq="Y", start="1/1/2001", end="12/1/2004")
2759 df = pd.DataFrame({"x": [1, 2, 3, 4], "y": [10, 20, 30, 40]}, index=index)
2760 ddf = dd.from_pandas(df, npartitions=3)
2761 assert_eq(ddf.to_timestamp(), df.to_timestamp(), check_freq=False)
2762 assert_eq(
2763 ddf.to_timestamp(freq="M", how="s").compute(),
2764 df.to_timestamp(freq="M", how="s"),
2765 check_freq=False,
2766 )
2767 assert_eq(ddf.x.to_timestamp(), df.x.to_timestamp(), check_freq=False)
2768 assert_eq(
2769 ddf.x.to_timestamp(freq="M", how="s").compute(),
2770 df.x.to_timestamp(freq="M", how="s"),
2771 check_freq=False,
2772 )
2773
2774 ddf = dd.from_pandas(df, npartitions=4)
2775 assert_eq(ddf.to_timestamp(how="end"), df.to_timestamp(how="end"))
2776 assert_eq(ddf.x.to_timestamp(how="end"), df.x.to_timestamp(how="end"))
2777
2778
2779def test_to_frame():

Callers

nothing calls this directly

Calls 3

assert_eqFunction · 0.90
to_timestampMethod · 0.45
computeMethod · 0.45

Tested by

no test coverage detected