Creating a DataFrame again after generating additional samples, fails when the original DataFrame was sparse.
pd.DataFrame.sparse.from_spmatrix is required instead of pd.DataFrame.
[...]
File "[...]/site-packages/imblearn/utils/_validation.py", line 39, in transform
X = self._transfrom_one(X, self.x_props)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "[...]/site-packages/imblearn/utils/_validation.py", line 64, in _transfrom_one
ret = pd.DataFrame(array, columns=props["columns"])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "[...]/site-packages/pandas/core/frame.py", line 798, in __init__
mgr = ndarray_to_mgr(
^^^^^^^^^^^^^^^
File "[...]/site-packages/pandas/core/internals/construction.py", line 337, in ndarray_to_mgr
_check_values_indices_shape_match(values, index, columns)
File "[...]/site-packages/pandas/core/internals/construction.py", line 408, in _check_values_indices_shape_match
raise ValueError(f"Shape of passed values is {passed}, indices imply {implied}")
ValueError: Shape of passed values is (26, 1), indices imply (26, 2)
Describe the bug
Creating a DataFrame again after generating additional samples, fails when the original DataFrame was sparse.
pd.DataFrame.sparse.from_spmatrix
is required instead ofpd.DataFrame
.Steps/Code to Reproduce
Expected Results
Code should run through without issues.
Actual Results
Versions