Skip to content

BUG: nanops.nanmedian doesn't work when axis=None #7352

Closed
@toddrjen

Description

@toddrjen

The default value for the axis argument for nanops.nanmedia is None. However, the function raises an exception when using this value:

>>> from pandas.core import nanops
>>> import bottleneck
>>> import numpy as np
>>> nanops._USE_BOTTLENECK = False
>>> 
>>> val = np.random.randn(13, 11, 7)
>>> 
>>> bottleneck.nanmedian(val, axis=None).ndim
0
>>> nanops.nanmedian(val, axis=None)
TypeError: unsupported operand type(s) for +=: 'NoneType' and 'int'
>>> nanops.nanmedian(val)
TypeError: unsupported operand type(s) for +=: 'NoneType' and 'int'

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugInternalsRelated to non-user accessible pandas implementationNumeric OperationsArithmetic, Comparison, and Logical operationsTestingpandas testing functions or related to the test suite

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions