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

Function test_float_nulls

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

Source from the content-addressed store, hash-verified

235
236@pytest.mark.pandas
237def test_float_nulls(version):
238 num_values = 100
239
240 path = random_path()
241 TEST_FILES.append(path)
242
243 null_mask = np.random.randint(0, 10, size=num_values) < 3
244 dtypes = ['f4', 'f8']
245 expected_cols = []
246
247 arrays = []
248 for name in dtypes:
249 values = np.random.randn(num_values).astype(name)
250 arrays.append(pa.array(values, mask=null_mask))
251
252 values[null_mask] = np.nan
253
254 expected_cols.append(values)
255
256 table = pa.table(arrays, names=dtypes)
257 _check_arrow_roundtrip(table)
258
259 df = table.to_pandas()
260 _check_pandas_roundtrip(df, version=version)
261
262
263@pytest.mark.pandas

Callers

nothing calls this directly

Calls 5

random_pathFunction · 0.85
_check_arrow_roundtripFunction · 0.85
_check_pandas_roundtripFunction · 0.70
appendMethod · 0.45
arrayMethod · 0.45

Tested by

no test coverage detected