MCPcopy Create free account
hub / github.com/PyTables/PyTables / _conv_python_to_numpy

Function _conv_python_to_numpy

tables/flavor.py:420–431  ·  view source on GitHub ↗
(array: npt.ArrayLike)

Source from the content-addressed store, hash-verified

418
419@_numpy_contiguous
420def _conv_python_to_numpy(array: npt.ArrayLike) -> np.ndarray:
421 nparr = toarray(array)
422 if nparr.dtype.kind == "U":
423 # from Python 3 loads of common strings are disguised as Unicode
424 try:
425 # try to convert to basic 'S' type
426 return nparr.astype("S")
427 except UnicodeEncodeError:
428 pass
429 # pass on true Unicode arrays downstream in case it can be
430 # handled in the future
431 return nparr
432
433
434def _conv_numpy_to_python(array: np.ndarray) -> Any | list[Any]:

Callers

nothing calls this directly

Calls 1

toarrayFunction · 0.85

Tested by

no test coverage detected