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
I am getting an error when indexing by comparing tuples:
In [13]: df = pd.DataFrame([[('A', 1), ('B', 0)], [('A', 0), ('B', 1)], [('A', 1), ('B', 0)]], columns=['A', 'B']) In [14]: df Out[14]: A B 0 (A, 1) (B, 0) 1 (A, 0) (B, 1) 2 (A, 1) (B, 0) In [15]: df[df.A == ('A', 1)] --------------------------------------------------------------------------- ValueError Traceback (most recent call last) <ipython-input-15-2663526e3e28> in <module>() ----> 1 df[df.A == ('A', 1)] /home/ankur/anaconda3/envs/py3/lib/python3.4/site-packages/pandas/core/ops.py in wrapper(self, other, axis) 724 op_desc = _op_descriptions[op_name] 725 if op_desc['reversed']: --> 726 equiv = 'other ' + op_desc['op'] + ' series' 727 else: 728 equiv = 'series ' + op_desc['op'] + ' other' /home/ankur/anaconda3/envs/py3/lib/python3.4/site-packages/pandas/core/ops.py in na_op(x, y) 642 if isinstance(y, list): 643 y = lib.list_to_object_array(y) --> 644 645 if isinstance(y, (np.ndarray, pd.Series)): 646 if (x.dtype == np.bool_ and pandas/lib.pyx in pandas.lib.vec_compare (pandas/lib.c:14361)() ValueError: Arrays were different lengths: 3 vs 2
But this used to work in 0.16.2, so not sure if this is expected or a bug.
The text was updated successfully, but these errors were encountered:
this is a dupe of: #11339
and fixed for 0.17.1
note that storing tuples inside a column is quite inefficient, and not recommended.
Sorry, something went wrong.
No branches or pull requests
I am getting an error when indexing by comparing tuples:
But this used to work in 0.16.2, so not sure if this is expected or a bug.
The text was updated successfully, but these errors were encountered: