pandas/core/construction.py
def _sanitize_ndim(
    result: ArrayLike, data, dtype: Optional[DtypeObj], index: Optional[Index]
) -> ArrayLike:
    """
    Ensure we have a 1-dimensional result array.
    """
    if getattr(result, "ndim", 0) == 0:
        raise ValueError("result should be arraylike with ndim > 0")

    elif result.ndim == 1:
        # the result that we want
        result = _maybe_repeat(result, index)

    elif result.ndim > 1:
        if isinstance(data, np.ndarray):
            raise ValueError("Data must be 1-dimensional")
        else:
            result = com.asarray_tuplesafe(data, dtype=dtype)
    return result

    Ensure we have a 1-dimensional result array.
    
Ensure we have a 1-dimensional result array.
Ensure we have a 1 - dimensional result array .
def _sanitize_ndim(
    result: ArrayLike, data, dtype: Optional[DtypeObj], index: Optional[Index]
) -> ArrayLike:
    if getattr(result, "ndim", 0) == 0:
        raise ValueError("result should be arraylike with ndim > 0")
    elif result.ndim == 1:
        result = _maybe_repeat(result, index)
    elif result.ndim > 1:
        if isinstance(data, np.ndarray):
            raise ValueError("Data must be 1-dimensional")
        else:
            result = com.asarray_tuplesafe(data, dtype=dtype)
    return result
def _sanitize_ndim ( result : ArrayLike , data , dtype : Optional [ DtypeObj ] , index : Optional [ Index ] ) -> ArrayLike : if getattr ( result , "ndim" , 0 ) == 0 : raise ValueError ( "result should be arraylike with ndim > 0" ) elif result . ndim == 1 : result = _maybe_repeat ( result , index ) elif result . ndim > 1 : if isinstance ( data , np . ndarray ) : raise ValueError ( "Data must be 1-dimensional" ) else : result = com . asarray_tuplesafe ( data , dtype = dtype ) return result
Ensure we have a 1-dimensional result array.
Ensure we have a 1 - dimensional result array .
"""
    Ensure we have a 1-dimensional result array.
    """ # the result that we want
result
ArrayLike
data
dtype
Optional[DtypeObj]
index
Optional[Index]