REF: use `_get_axis_number` instead of `if axis in [...]`:
See original GitHub issueThis PR regards searching the non-test codebase (i.e. don’t find code examples in pandas/tests) for examples like the following:
Try to find and replace logic like:
if axis in [0, "index"]:
...
elif axis in [1, "columns"]:
...
else:
...
with the standard codebase method get_axis_number(axis)
. This is a DataFrame method so often you need use local DataFrame objects to call this method.
It may also be necessary to change axis
args in internal methods to consistently accept the same input format compatible with this method, i.e. axis as an integer (0 or 1).
This is an open issue and contributions are welcome to solve individual files in the code. As an example see #43078 or other merged contributions below.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:3
- Comments:38 (12 by maintainers)
Top Results From Across the Web
C++ - Zaber Motion Library (ASCII)
No arguments. Return Value. bool True if any axis is currently executing a motion command. ... Obsolete: Use GetAxisNumbers instead. lockstep.getAxes().
Read more >How do I get a list of axes for a figure in pyplot? - Stack Overflow
It seems that get_axes() returns two object, AxesSubplot, and Axes. But how can I get an AxesStack object for my figure? (So if...
Read more >matplotlib.axes — Matplotlib 3.6.2 documentation
Set whether autoscaling is applied to each axis on the next draw or call to Axes.autoscale_view . Axes.get_autoscale_on. Return True if each axis...
Read more >InstrumentKit Library Documentation, Release 0.6.0
An example when this can happen is if you are using a USB to Serial adapter and ... Get axis number of Newport...
Read more >XPathParser.java - Saxon - Saxonica Developer Community
@return the code injector in use, if any; or null otherwise. */. /*@Nullable*/ ... AXIS: byte axis;. try {. axis = AxisInfo.getAxisNumber(t.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Anyone is welcome to work on this issue. This will not be solved by just one PR, there are likely many places and many files where the same work needs to be done. Therefore many people can work on this, simultaneously.
Did a quick search of the codebase and outside of all the test files this seems to have been addressed by all contributions now.