Skip to content
New issue

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

ValueError: Length mismatch with Tests #7

Open
gsheni opened this issue Apr 3, 2020 · 2 comments
Open

ValueError: Length mismatch with Tests #7

gsheni opened this issue Apr 3, 2020 · 2 comments

Comments

@gsheni
Copy link
Contributor

gsheni commented Apr 3, 2020

  • While running the tests locally for branch fix_requirements_jupyter, I am getting the following error:
Traceback (most recent call last):
  File "/.pyenv/versions/3.6.9/lib/python3.6/multiprocessing/process.py", line 258, in _bootstrap
    self.run()
  File "/.pyenv/versions/3.6.9/lib/python3.6/multiprocessing/process.py", line 93, in run
    self._target(*self._args, **self._kwargs)
  File "/categorical_encoding/venv/lib/python3.6/site-packages/category_encoders/hashing.py", line 189, in __require_data
    data_part = self.hashing_trick(X_in=data_part, hashing_method=self.hash_method, N=self.n_components, cols=self.cols)
  File "/categorical_encoding/venv/lib/python3.6/site-packages/category_encoders/hashing.py", line 377, in hashing_trick
    X_cat.columns = new_cols
  File "/categorical_encoding/venv/lib/python3.6/site-packages/pandas/core/generic.py", line 5287, in __setattr__
    return object.__setattr__(self, name, value)
  File "pandas/_libs/properties.pyx", line 67, in pandas._libs.properties.AxisProperty.__set__
  File "/categorical_encoding/venv/lib/python3.6/site-packages/pandas/core/generic.py", line 661, in _set_axis
    self._data.set_axis(axis, labels)
  File "/categorical_encoding/venv/lib/python3.6/site-packages/pandas/core/internals/managers.py", line 178, in set_axis
    f"Length mismatch: Expected axis has {old_len} elements, new "
ValueError: Length mismatch: Expected axis has 2 elements, new values have 8 elements
Traceback (most recent call last):
  File "/.pyenv/versions/3.6.9/lib/python3.6/multiprocessing/process.py", line 258, in _bootstrap
    self.run()
  File "/.pyenv/versions/3.6.9/lib/python3.6/multiprocessing/process.py", line 93, in run
    self._target(*self._args, **self._kwargs)
  File "/categorical_encoding/venv/lib/python3.6/site-packages/category_encoders/hashing.py", line 189, in __require_data
    data_part = self.hashing_trick(X_in=data_part, hashing_method=self.hash_method, N=self.n_components, cols=self.cols)
  File "/categorical_encoding/venv/lib/python3.6/site-packages/category_encoders/hashing.py", line 377, in hashing_trick
    X_cat.columns = new_cols
  File "/categorical_encoding/venv/lib/python3.6/site-packages/pandas/core/generic.py", line 5287, in __setattr__
    return object.__setattr__(self, name, value)
  File "pandas/_libs/properties.pyx", line 67, in pandas._libs.properties.AxisProperty.__set__
  File "/categorical_encoding/venv/lib/python3.6/site-packages/pandas/core/generic.py", line 661, in _set_axis
    self._data.set_axis(axis, labels)
  File "/categorical_encoding/venv/lib/python3.6/site-packages/pandas/core/internals/managers.py", line 178, in set_axis
    f"Length mismatch: Expected axis has {old_len} elements, new "
ValueError: Length mismatch: Expected axis has 2 elements, new values have 8 elements
@gsheni gsheni changed the title ValueError ValueError: Length mismatch with Tests Apr 3, 2020
@rwedge
Copy link
Contributor

rwedge commented Apr 3, 2020

Downgrading category_encoders to 2.0.0 fixed the tests failing for me.

@rwedge
Copy link
Contributor

rwedge commented Apr 3, 2020

#6 puts a bandaid on this for now but we should figure out why this fails with the new version of category_encoders

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants