Skip to content

special.softmax() should support pd.DataFrame as input #12164

@thenineteen

Description

@thenineteen

Is your feature request related to a problem? Please describe.
when the input df is of type pandas.core.frame.DataFrame, softmax(df) doesn't work:

gives this error

C:\ProgramData\Anaconda3\lib\site-packages\pandas\core\ops\__init__.py in _align_method_FRAME(left, right, axis)
    662             else:
    663                 raise ValueError(
--> 664                     "Unable to coerce to DataFrame, shape "
    665                     f"must be {left.shape}: given {right.shape}"
    666                 )

Describe the solution you'd like
should be able to run softmax(df)

Describe alternatives you've considered
currently have to either run:

softmax(df.values)

or

softmax(np.array(df))

Additional context (e.g. screenshots)

Metadata

Metadata

Assignees

No one assigned

    Labels

    defectA clear bug or issue that prevents SciPy from being installed or used as expectedscipy.special

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions