top | item 45599681

(no title)

jofer | 4 months ago

That one's new to me. Thanks! (With that said, I worry that 3rd party libs are a bad place for types for numpy.)

discuss

order

nerdponx|4 months ago

Numpy ships built-in type hints as well as a type for hinting arrays in your own code (numpy.typing.NDArray).

The real challenge is denoting what you can accept as input. `NDArray[np.floating] | pd.Series[float] | float` is a start but doesn't cover everything especially if you are a library author trying to provide a good type-hinted API.

jofer|4 months ago

I'm aware of that. As explained in the original comment, not being able to denote dimensionality in those is a major limitation.