def myfunc(a):
print(a)
return a[0]
vfunc = np.vectorize(myfunc, signature='(m)->()')
vfunc([[1, 2], [3, 4], [5, 6]])
output:
[1 2]
[3 4]
[5 6]
array([1, 3, 5])
chg-hou/numpy-tricks
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
No description, website, or topics provided.
Resources
License
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published