question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

REF: use `_get_axis_number` instead of `if axis in [...]`:

See original GitHub issue

This 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:closed
  • Created 2 years ago
  • Reactions:3
  • Comments:38 (12 by maintainers)

github_iconTop GitHub Comments

3reactions
attack68commented, Aug 19, 2021

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.

0reactions
attack68commented, Aug 31, 2021

Did a quick search of the codebase and outside of all the test files this seems to have been addressed by all contributions now.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found