@@ -80,7 +80,7 @@ def nearest_idx(array, value, axis=None):
80
80
return argmin (abs (array - value ), axis = axis )
81
81
82
82
83
- def indexer (arr , axis = 0 , index_name = None ):
83
+ def indexer (arr , index_name = None , axis = 0 ):
84
84
"""
85
85
Utility function for when you want to index an array as part of an interactive function.
86
86
For example: ``iplt.plot(indexor(arr), idx = np.arange(5))``
@@ -89,11 +89,11 @@ def indexer(arr, axis=0, index_name=None):
89
89
----------
90
90
arr : arraylike
91
91
The array to be indexed
92
- axis : int
93
- which axis to index, default to first axis
94
92
index_name : str, default: None
95
93
The name of the variable the returned function should expect to receive.
96
94
If ``None`` then the function will check for ``idx``, ``index``, ``ind``, and ``indx``.
95
+ axis : int
96
+ which axis to index, default to first axis
97
97
98
98
Returns
99
99
-------
@@ -106,7 +106,7 @@ def indexer(arr, axis=0, index_name=None):
106
106
else :
107
107
idxs = [index_name ]
108
108
109
- def f (** kwargs ):
109
+ def f (* args , * *kwargs ):
110
110
for i in idxs :
111
111
if i in kwargs :
112
112
return np .take (arr , kwargs [i ], axis = axis )
0 commit comments