-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: Pandas any() returning false with true values present (GH #23070) #24434
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
Conversation
pandas/core/frame.py
Outdated
@@ -7291,7 +7291,7 @@ def f(x): | |||
if filter_type is None or filter_type == 'numeric': | |||
data = self._get_numeric_data() | |||
elif filter_type == 'bool': | |||
data = self._get_bool_data() | |||
data = self._get_data() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can just make this:
data = self
no need for other things here
@@ -1394,6 +1394,23 @@ def test_any_all_extra(self): | |||
# df.any(1, bool_only=True) | |||
# df.all(1, bool_only=True) | |||
|
|||
def test_any_datetime(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you remove the commented code above (or see if it does anything)
cb573ce
to
85a702d
Compare
Codecov Report
@@ Coverage Diff @@
## master #24434 +/- ##
==========================================
- Coverage 92.3% 92.3% -0.01%
==========================================
Files 163 163
Lines 51987 51982 -5
==========================================
- Hits 47989 47984 -5
Misses 3998 3998
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #24434 +/- ##
==========================================
- Coverage 92.31% 92.31% -0.01%
==========================================
Files 166 166
Lines 52335 52412 +77
==========================================
+ Hits 48313 48382 +69
- Misses 4022 4030 +8
Continue to review full report at Codecov.
|
doc/source/whatsnew/v0.24.0.rst
Outdated
@@ -1369,6 +1369,7 @@ Timezones | |||
- Bug in :class:`Timestamp` constructor where a ``dateutil.tz.tzutc`` timezone passed with a ``datetime.datetime`` argument would be converted to a ``pytz.UTC`` timezone (:issue:`23807`) | |||
- Bug in :func:`to_datetime` where ``utc=True`` was not respected when specifying a ``unit`` and ``errors='ignore'`` (:issue:`23758`) | |||
- Bug in :func:`to_datetime` where ``utc=True`` was not respected when passing a :class:`Timestamp` (:issue:`24415`) | |||
- Bug in :meth:`DataFrame.any` returns wrong value when the axis is one and the data is of datetime type (:issue:`23070`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in double-backticks say axis=1
and data type is datetimelike
85a702d
to
24885c9
Compare
The test_any_all is failed in python2. An error is raised in line 239. pandas/pandas/tests/frame/test_analytics.py Lines 231 to 240 in 70bc919
Lines 7293 to 7294 in 70bc919
The test with |
thanks @makbigc |
* upstream/master: DOC: Fixing broken references in the docs (pandas-dev#24497) DOC: Splitting api.rst in several files (pandas-dev#24462) Fix misdescription in escapechar (pandas-dev#24490) Floor and ceil methods during pandas.eval which are provided by numexpr (pandas-dev#24355) BUG: Pandas any() returning false with true values present (GH pandas-dev#23070) (pandas-dev#24434) Misc separable pieces of pandas-dev#24024 (pandas-dev#24488) use capsys.readouterr() as named tuple (pandas-dev#24489) REF/TST: replace capture_stderr with pytest capsys fixture (pandas-dev#24496) TST- Fixing issue with test_parquet test unexpectedly passing (pandas-dev#24480) DOC: Doc build for a single doc made much faster, and clean up (pandas-dev#24428) BUG: Fix+test timezone-preservation in DTA.repeat (pandas-dev#24483) Implement reductions from pandas-dev#24024 (pandas-dev#24484)
…strings * upstream/master: TST: Skip db tests unless explicitly specified in -m pattern (pandas-dev#24492) Mix EA into DTA/TDA; part of 24024 (pandas-dev#24502) DOC: Fix building of a single API document (pandas-dev#24506) DOC: Fixing broken references in the docs (pandas-dev#24497) DOC: Splitting api.rst in several files (pandas-dev#24462) Fix misdescription in escapechar (pandas-dev#24490) Floor and ceil methods during pandas.eval which are provided by numexpr (pandas-dev#24355) BUG: Pandas any() returning false with true values present (GH pandas-dev#23070) (pandas-dev#24434) Misc separable pieces of pandas-dev#24024 (pandas-dev#24488) use capsys.readouterr() as named tuple (pandas-dev#24489) REF/TST: replace capture_stderr with pytest capsys fixture (pandas-dev#24496) TST- Fixing issue with test_parquet test unexpectedly passing (pandas-dev#24480) DOC: Doc build for a single doc made much faster, and clean up (pandas-dev#24428) BUG: Fix+test timezone-preservation in DTA.repeat (pandas-dev#24483) Implement reductions from pandas-dev#24024 (pandas-dev#24484)
git diff upstream/master -u -- "*.py" | flake8 --diff