---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
~/.local/lib/python3.6/site-packages/pandas/core/internals/managers.py in create_block_manager_from_blocks(blocks, axes)
1676 blocks = [
-> 1677 make_block(values=blocks[0], placement=slice(0, len(axes[0])))
1678 ]
~/.local/lib/python3.6/site-packages/pandas/core/internals/blocks.py in make_block(values, placement, klass, ndim, dtype, fastpath)
3264
-> 3265 return klass(values, ndim=ndim, placement=placement)
3266
~/.local/lib/python3.6/site-packages/pandas/core/internals/blocks.py in __init__(self, values, placement, ndim)
127 "Wrong number of items passed {val}, placement implies "
--> 128 "{mgr}".format(val=len(self.values), mgr=len(self.mgr_locs))
129 )
ValueError: Wrong number of items passed 3, placement implies 2
During handling of the above exception, another exception occurred:
ValueError Traceback (most recent call last)
<ipython-input-13-63a9163dccc4> in <module>
----> 1 fit_df = pd.DataFrame(fit, columns=['x1', 'x2'])
2 df = pd.concat([fit_df, y], axis=1)
~/.local/lib/python3.6/site-packages/pandas/core/frame.py in __init__(self, data, index, columns, dtype, copy)
437 mgr = init_dict({data.name: data}, index, columns, dtype=dtype)
438 else:
--> 439 mgr = init_ndarray(data, index, columns, dtype=dtype, copy=copy)
440
441 # For data is list-like, or Iterable (will consume into list)
~/.local/lib/python3.6/site-packages/pandas/core/internals/construction.py in init_ndarray(values, index, columns, dtype, copy)
211 block_values = [values]
212
--> 213 return create_block_manager_from_blocks(block_values, [columns, index])
214
215
~/.local/lib/python3.6/site-packages/pandas/core/internals/managers.py in create_block_manager_from_blocks(blocks, axes)
1685 blocks = [getattr(b, "values", b) for b in blocks]
1686 tot_items = sum(b.shape[0] for b in blocks)
-> 1687 construction_error(tot_items, blocks[0].shape[1:], axes, e)
1688
1689
~/.local/lib/python3.6/site-packages/pandas/core/internals/managers.py in construction_error(tot_items, block_shape, axes, e)
1716 raise ValueError("Empty data passed with indices specified.")
1717 raise ValueError(
-> 1718 "Shape of passed values is {0}, indices imply {1}".format(passed, implied)
1719 )
1720
ValueError: Shape of passed values is (24795, 3), indices imply (24795, 2)