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

Function toarray

tables/flavor.py:357–368  ·  view source on GitHub ↗

Convert the input to a numpy array if needed.

(array: npt.ArrayLike, *args, **kwargs)

Source from the content-addressed store, hash-verified

355if np.lib.NumpyVersion(np.__version__) >= np.lib.NumpyVersion("1.19.0"):
356
357 def toarray(array: npt.ArrayLike, *args, **kwargs) -> np.ndarray:
358 """Convert the input to a numpy array if needed."""
359 with warnings.catch_warnings():
360 warnings.simplefilter("error")
361 try:
362 array = np.array(array, *args, **kwargs)
363 except VisibleDeprecationWarning:
364 raise ValueError(
365 "cannot guess the desired dtype from the input"
366 )
367
368 return array
369
370else:
371 toarray = np.array

Callers 2

_point_selectionMethod · 0.85
_conv_python_to_numpyFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected