Flexible and powerful data analysis / manipulation library for Python, providing labeled data structures similar to R data.frame objects, statistical functions, and much more
Get an exception: ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().
This issue applies to both Series and DataFrame, that equals method failed if there is a nested Series or DataFrame.
Note that pd.testing.assert_series_equal(foo, bar) still works.
[x] I have checked that this issue has not already been reported.
[x] I have confirmed this bug exists on the latest version of pandas.
[ ] (optional) I have confirmed this bug exists on the master branch of pandas.
Note: Please read this guide detailing how to provide the necessary information for us to reproduce your bug.
Code Sample, a copy-pastable example
Problem description
Get an exception:
ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().
This issue applies to bothSeries
andDataFrame
, thatequals
method failed if there is a nestedSeries
orDataFrame
. Note thatpd.testing.assert_series_equal(foo, bar)
still works.Expected Output
True
Output of
pd.show_versions()