-
-
Notifications
You must be signed in to change notification settings - Fork 11.1k
Closed
Description
Since #15119, np.apply_along_axis
throws a DeprecatedWarning when func1d returns object dtype.
I am using it with scipy.signal.find_peaks
since it easily allows to keep shape, Numpy's indexing style, etc.
I am expecting that it will become an error at some point in the future.
Would it be possible to add a dtype
kwarg?
Reproducing code example:
import numpy as np
def foo(dummy):
return 1,"1",[1],(1,)
arr = np.apply_along_axis(foo, -1, np.random.randn(5,2,200))
Error message:
/usr/lib/python3/dist-packages/numpy/core/_asarray.py:136: VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences (which is a list-or-tuple of lists-or-tuples-or ndarrays with different lengths or shapes) is deprecated. If you meant to do this, you must specify 'dtype=object' when creating the ndarray
Numpy/Python version information:
1.19.1 3.8.5 (default, Aug 2 2020, 15:09:07)
[GCC 10.2.0]
Metadata
Metadata
Assignees
Labels
No labels