

@classmethod
def _coerce_to_ndarray(cls, data):
    'coerces data to ndarray, raises on scalar data. Converts other\n        iterables to list first and then to array. Does not touch ndarrays.\n        '
    if (not isinstance(data, (np.ndarray, Index))):
        if ((data is None) or lib.isscalar(data)):
            cls._scalar_data_error(data)
        if (not isinstance(data, (ABCSeries, list, tuple))):
            data = list(data)
        data = np.asarray(data)
    return data

dataset/ETHPy150Open pydata/pandas/pandas/indexes/base.py Index._coerce_to_ndarray/original