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
Simple usecase of DataFrame#where fails on a freshly installed latest Pandas release:
DataFrame#where
In [1]: df = DataFrame([1, 2]); df Out[1]: 0 0 1 1 2 In [2]: df.where(df[0]==1) --------------------------------------------------------------------------- TypeError Traceback (most recent call last) <ipython-input-2-7b64bb424f7b> in <module>() ----> 1 df.where(df[0]==1) /home/dunpeal/.env/lib/python3.4/site-packages/pandas/core/generic.py in where(self, cond, other, inplace, axis, level, try_cast, raise_on_error) 3445 3446 if isinstance(cond, NDFrame): -> 3447 cond = cond.reindex(**self._construct_axes_dict()) 3448 else: 3449 if not hasattr(cond, 'shape'): /home/dunpeal/.env/lib/python3.4/site-packages/pandas/core/series.py in reindex(self, index, **kwargs) 2142 @Appender(generic._shared_docs['reindex'] % _shared_doc_kwargs) 2143 def reindex(self, index=None, **kwargs): -> 2144 return super(Series, self).reindex(index=index, **kwargs) 2145 2146 @Appender(generic._shared_docs['fillna'] % _shared_doc_kwargs) /home/dunpeal/.env/lib/python3.4/site-packages/pandas/core/generic.py in reindex(self, *args, **kwargs) 1747 if kwargs: 1748 raise TypeError('reindex() got an unexpected keyword ' -> 1749 'argument "{0}"'.format(list(kwargs.keys())[0])) 1750 1751 self._consolidate_inplace() TypeError: reindex() got an unexpected keyword argument "columns"
The text was updated successfully, but these errors were encountered:
use
In [2]: df.where(df[[0]]==1) Out[2]: 0 0 1 1 NaN In [3]: df[df[0]==1] Out[3]: 0 0 1
will mark this as a bug in any event I don't think this worked previously. pull-requests are welcome
Sorry, something went wrong.
BUG: DataFrame.where does not handle Series slice correctly (fixes pa…
96148be
…ndas-dev#10218)
a25a664
Merge pull request #10283 from mortada/df_where
b55ca5c
BUG: DataFrame.where does not handle Series slice correctly (#10218)
Successfully merging a pull request may close this issue.
Simple usecase of
DataFrame#where
fails on a freshly installed latest Pandas release:The text was updated successfully, but these errors were encountered: