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

Function test_float_nulls

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

Source from the content-addressed store, hash-verified

228
229@pytest.mark.pandas
230def test_float_nulls(version):
231 num_values = 100
232
233 path = random_path()
234 TEST_FILES.append(path)
235
236 null_mask = np.random.randint(0, 10, size=num_values) < 3
237 dtypes = ['f4', 'f8']
238 expected_cols = []
239
240 arrays = []
241 for name in dtypes:
242 values = np.random.randn(num_values).astype(name)
243 arrays.append(pa.array(values, mask=null_mask))
244
245 values[null_mask] = np.nan
246
247 expected_cols.append(values)
248
249 table = pa.table(arrays, names=dtypes)
250 _check_arrow_roundtrip(table)
251
252 df = table.to_pandas()
253 _check_pandas_roundtrip(df, version=version)
254
255
256@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