other:python:misc_by_jyp
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | Next revisionBoth sides next revision | ||
other:python:misc_by_jyp [2022/02/21 15:47] – [numpy related stuff] Added np.unique example jypeter | other:python:misc_by_jyp [2022/02/21 16:15] – [numpy related stuff] jypeter | ||
---|---|---|---|
Line 230: | Line 230: | ||
>>> | >>> | ||
array([1. , 2. , 1. , 2. , 2. , 1.5, 1. , 1.5, 2. , 1.5]) | array([1. , 2. , 1. , 2. , 2. , 1.5, 1. , 1.5, 2. , 1.5]) | ||
+ | |||
>>> | >>> | ||
array([1. , 1.5, 2. ]) | array([1. , 1.5, 2. ]) | ||
- | >>> | + | >>> |
- | (array([1. , 1.5, 2. ]), array([3, 3, 4])) | + | >>> |
- | >>> | + | array([1. , 1.5, 2. ]) |
+ | >>> | ||
+ | array([3, 3, 4]) | ||
+ | |||
+ | >>> | ||
+ | >>> | ||
array([1. , 1. , 1. , 1.5, 1.5, 1.5, 2. , 2. , 2. , 2. ])</ | array([1. , 1. , 1. , 1.5, 1.5, 1.5, 2. , 2. , 2. , 2. ])</ | ||
+ | === Applying a ufunc over all the elements of an array === | ||
+ | |||
+ | There are all sorts of //ufuncs// (Universal Functions), and we will just use below '' | ||
+ | |||
+ | < | ||
+ | >>> | ||
+ | 15.5 | ||
+ | >>> | ||
+ | 15.5 | ||
+ | >>> | ||
+ | 15.5</ | ||
/* | /* |
other/python/misc_by_jyp.txt · Last modified: 2024/11/04 15:01 by jypeter