pandas
pandas copied to clipboard
DOC: Inconsistent and incomplete documentation of `pandas.eval`
Pandas version checks
- [X] I have checked that the issue still exists on the latest versions of the docs on
mainhere
Location of the documentation
- https://pandas.pydata.org/docs/reference/api/pandas.eval.html
- https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.eval.html
- https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.query.html
Documentation problem
- (1) doesn't cover all supported operators within the
exprstring, e.g.,<orsine.t.c., - (2) doesn't explain how
exprshould look like. Admittedly it links to (1) but only inkwargssection. - (3) doesn't explain how
exprshould look like, albeit it explains how to use columns within theexpr. Admittedly it links to (1) but only inkwargssection.
Suggested fix for documentation
- Expand (1) to cover all supported operators and functions
- To
exprsections of (2) and (3) add links leading to (1) for description ofexpr - Move description of
exprfrom (3) to (2) and add another link to that section leading to (2) (to explain how one can use columns)- Alternatively just add link to
exprsection of (2) leading to (3) (to explain columns) instead. Albeit personally i feel it is easier to have theevalas main source andquerylink there asqueryis equivalent ofdf[df.eval(...)]
- Alternatively just add link to
Thanks for the suggestions - agreed this could be improved. +1 on all counts, and I too would prefer not doing your alternative suggestion.
take
@droussea2001 are you still working on this? If not I am happy to take it
Hello @JonathanMarriott : no you can take it :-)
take