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

Function test_array_from_py_float32

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

Source from the content-addressed store, hash-verified

4012
4013
4014def test_array_from_py_float32():
4015 data = [[1.2, 3.4], [9.0, 42.0]]
4016
4017 t = pa.float32()
4018
4019 arr1 = pa.array(data[0], type=t)
4020 arr2 = pa.array(data, type=pa.list_(t))
4021
4022 expected1 = np.array(data[0], dtype=np.float32)
4023 expected2 = pd.Series([np.array(data[0], dtype=np.float32),
4024 np.array(data[1], dtype=np.float32)])
4025
4026 assert arr1.type == t
4027 assert arr1.equals(pa.array(expected1))
4028 assert arr2.equals(pa.array(expected2))
4029
4030
4031# ----------------------------------------------------------------------

Callers

nothing calls this directly

Calls 2

equalsMethod · 0.80
arrayMethod · 0.45

Tested by

no test coverage detected