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

Function _test_dict

python/pyarrow/tests/parquet/common.py:98–115  ·  view source on GitHub ↗
(size=10000, seed=0)

Source from the content-addressed store, hash-verified

96
97
98def _test_dict(size=10000, seed=0):
99 np.random.seed(seed)
100 return {
101 'uint8': _random_integers(size, np.uint8),
102 'uint16': _random_integers(size, np.uint16),
103 'uint32': _random_integers(size, np.uint32),
104 'uint64': _random_integers(size, np.uint64),
105 'int8': _random_integers(size, np.int8),
106 'int16': _random_integers(size, np.int16),
107 'int32': _random_integers(size, np.int32),
108 'int64': _random_integers(size, np.int64),
109 'float32': np.random.randn(size).astype(np.float32),
110 'float64': np.arange(size, dtype=np.float64),
111 'bool': np.random.randn(size) > 0,
112 'strings': [util.rands(10) for i in range(size)],
113 'all_none': [None] * size,
114 'all_none_category': [None] * size
115 }
116
117
118def _test_dataframe(size=10000, seed=0):

Callers 2

_test_dataframeFunction · 0.85
_test_tableFunction · 0.85

Calls 1

_random_integersFunction · 0.85

Tested by

no test coverage detected