We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
seems df construction fail at some special cases, have seen the errors in multiple PRs
@pytest.mark.xfail(_is_numpy_dev, reason="Interprets list of frame as 3D") def test_constructor_list_frames(self): # see gh-3243 > result = DataFrame([DataFrame()]) pandas/tests/frame/test_constructors.py:153: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ pandas/core/frame.py:514: in __init__ mgr = init_ndarray(data, index, columns, dtype=dtype, copy=copy) pandas/core/internals/construction.py:190: in init_ndarray values = _prep_ndarray(values, copy=copy) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ values = array([], shape=(1, 0, 0), dtype=float64), copy = False def _prep_ndarray(values, copy: bool = True) -> np.ndarray: if not isinstance(values, (np.ndarray, ABCSeries, Index)): if len(values) == 0: return np.empty((0, 0), dtype=object) elif isinstance(values, range): arr = np.arange(values.start, values.stop, values.step, dtype="int64") return arr[..., np.newaxis] def convert(v): return maybe_convert_platform(v) # we could have a 1-dim or 2-dim list here # this is equiv of np.asarray, but does object conversion # and platform dtype preservation try: if is_list_like(values[0]) or hasattr(values[0], "len"): values = np.array([convert(v) for v in values]) elif isinstance(values[0], np.ndarray) and values[0].ndim == 0: # GH#21861 values = np.array([convert(v) for v in values]) else: values = convert(values) except (ValueError, TypeError): values = convert(values) else: # drop subclass info, do not copy data values = np.asarray(values) if copy: values = values.copy() if values.ndim == 1: values = values.reshape((values.shape[0], 1)) elif values.ndim != 2: > raise ValueError("Must pass 2-d input") E ValueError: Must pass 2-d input
The text was updated successfully, but these errors were encountered:
No branches or pull requests
seems df construction fail at some special cases, have seen the errors in multiple PRs
The text was updated successfully, but these errors were encountered: