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

Function test_category

python/pyarrow/tests/test_feather.py:468–476  ·  view source on GitHub ↗
(version)

Source from the content-addressed store, hash-verified

466
467@pytest.mark.pandas
468def test_category(version):
469 repeats = 1000
470 values = ['foo', None, 'bar', 'qux', np.nan]
471 df = pd.DataFrame({'strings': values * repeats})
472 df['strings'] = df['strings'].astype('category')
473
474 values = ['foo', None, 'bar', 'qux', None]
475 expected = pd.DataFrame({'strings': pd.Categorical(values * repeats)})
476 _check_pandas_roundtrip(df, expected, version=version)
477
478
479@pytest.mark.pandas

Callers

nothing calls this directly

Calls 1

_check_pandas_roundtripFunction · 0.70

Tested by

no test coverage detected