MCPcopy Create free account
hub / github.com/apache/arrow / _fully_loaded_dataframe_example

Function _fully_loaded_dataframe_example

python/pyarrow/tests/test_pandas.py:3329–3349  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

3327
3328
3329def _fully_loaded_dataframe_example():
3330 index = pd.MultiIndex.from_arrays([
3331 pd.date_range('2000-01-01', periods=5).repeat(2),
3332 np.tile(np.array(['foo', 'bar'], dtype=object), 5)
3333 ])
3334
3335 c1 = pd.date_range('2000-01-01', periods=10)
3336 data = {
3337 "col0": c1,
3338 "col1": c1.tz_localize('utc'),
3339 "col2": c1.tz_localize('US/Eastern'),
3340 "col3": c1[::2].tz_localize('utc').repeat(2).astype('category'),
3341 "col4": ['foo', 'bar'] * 5,
3342 "col5": pd.Series(['foo', 'bar'] * 5).astype('category').values,
3343 "col6": [True, False] * 5,
3344 "col7": np.random.randn(10),
3345 "col8": np.random.randint(0, 100, size=10),
3346 "col9": pd.period_range('2013', periods=10, freq='M'),
3347 "col10": pd.interval_range(start=1, freq=1, periods=10),
3348 }
3349 return pd.DataFrame(data, index=index)
3350
3351
3352def test_roundtrip_fully_loaded_dataframe_example():

Calls 1

arrayMethod · 0.45

Tested by

no test coverage detected