Are you on the latest chainladder version?
Describe the bug in words
Consider the following example:
import pandas as pd
df1 = pd.DataFrame({'a': [1, 2], 'b': [4, 5]})
df2 = pd.DataFrame({'a': [1, 3], 'b': [7, 5]})
df1 == df2
a b
0 True False
1 False True
df1.equals(df2)
True
The == operator does elementwise comparison, returning an array of bools. The .equals method compares the whole object, returning a boolean scalar.
How can the bug be reproduced?
Chainladder does not have elementwise comparison, and the == acts as whole-object comparison
import chainladder as cl
raa = cl.load_sample('raa')
raa == raa
True
raa.equals(raa)
Traceback (most recent call last):
~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<ipython-input-36-a11e75dbc397>", line 1, in <module>
raa.equals(raa)
^^^^^^^^^^
AttributeError: 'Triangle' object has no attribute 'equals'
What is the expected behavior?
== should do elementwise comparison. The .equals() method should be defined to do whole-object comparison, replacing the current functionality of ==.
Would you be willing to contribute this ticket?
Are you on the latest chainladder version?
Describe the bug in words
Consider the following example:
The
==operator does elementwise comparison, returning an array of bools. The.equalsmethod compares the whole object, returning a boolean scalar.How can the bug be reproduced?
Chainladder does not have elementwise comparison, and the
==acts as whole-object comparisonWhat is the expected behavior?
==should do elementwise comparison. The.equals()method should be defined to do whole-object comparison, replacing the current functionality of==.Would you be willing to contribute this ticket?