()
| 2755 | |
| 2756 | |
| 2757 | def 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 | |
| 2779 | def test_to_frame(): |
nothing calls this directly
no test coverage detected