Skip to content
This repository was archived by the owner on Jul 16, 2019. It is now read-only.
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions dask_cudf/tests/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,23 @@ def test_set_index(nelem):
dd.assert_eq(expect, got, check_index=False, check_divisions=False)


def test_timeseries_index():

df = pd.DataFrame()
df['date'] = pd.date_range('11/20/2018', periods=72, freq='D')
df['value'] = np.random.sample(len(df))

gdf = cudf.DataFrame.from_pandas(df)
ddf = dgd.from_cudf(gdf, npartitions=2)

ddf_ts_idx = ddf.set_index('date')

got = ddf_ts_idx.compute().to_pandas()
expect = df.set_index('date')

dd.assert_eq(got, expect, check_index=False, check_divisions=False)


def assert_frame_equal_by_index_group(expect, got):
assert sorted(expect.columns) == sorted(got.columns)
assert sorted(set(got.index)) == sorted(set(expect.index))
Expand Down