from_sequence

from_sequence#

classmethod NestedExtensionArray.from_sequence(scalars, *, dtype: NestedDtype | pd.ArrowDtype | pa.DataType = None) Self[source]#

Construct a NestedExtensionArray from a sequence of items

Parameters:
  • scalars (Sequence) – The sequence of items: dictionaries (key is column name, value is array-like of nested elements), DataFrames, None, pd.NA, pa.Array or anything convertible to PyArrow scalars of struct type with list fields of the same lengths.

  • dtype (dtype or None) – NestedDtype of the resulting array, or a type to infer from: pd.ArrowDtype or pa.DataType.

Returns:

The constructed extension array.

Return type:

NestedExtensionArray