pandas-dev / pandas

Flexible and powerful data analysis / manipulation library for Python, providing labeled data structures similar to R data.frame objects, statistical functions, and much more
https://pandas.pydata.org
BSD 3-Clause "New" or "Revised" License
43.39k stars 17.83k forks source link

API: disallow frame.__and__(other, axis="foo", fill_value="bar") etc #36796

Closed jbrockmendel closed 3 years ago

jbrockmendel commented 3 years ago

For code-sharing purposes we re-use ops.arith_method_FRAME for both flex and non-flex methods. As a result, the non-flex methods have the flex signature, and accept arguments not generally accepted by dunder methods. We even have a few tests e.g.

result = d.__and__(s, axis="columns")
result = d.__and__(s, axis=0)

in tests.frame.test_operators.

Should we disallow passing these arguments? Is it relevant that we do not have flex versions of and/or/xor?

jreback commented 3 years ago

Should we disallow passing these arguments?

yes

Is it relevant that we do not have flex versions of and/or/xor?

no; I mean we could have .and,.or,.xor prob not very useful anyhow.