MCPcopy
hub / github.com/pandas-dev/pandas / convert

Function convert

pandas/core/internals/construction.py:516–524  ·  view source on GitHub ↗
(v)

Source from the content-addressed store, hash-verified

514 return arr[..., np.newaxis]
515
516 def convert(v):
517 if not is_list_like(v) or isinstance(v, ABCDataFrame):
518 return v
519
520 v = extract_array(v, extract_numpy=True)
521 res = maybe_convert_platform(v)
522 # We don't do maybe_infer_objects here bc we will end up doing
523 # it column-by-column in ndarray_to_mgr
524 return res
525
526 # we could have a 1-dim or 2-dim list here
527 # this is equiv of np.asarray, but does object conversion

Calls 8

construct_array_typeMethod · 0.95
extract_arrayFunction · 0.90
maybe_convert_platformFunction · 0.90
StringDtypeClass · 0.90
maybe_cast_to_datetimeFunction · 0.90
dtypeMethod · 0.45
_from_sequenceMethod · 0.45
construct_array_typeMethod · 0.45