You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Ulist is an ultra fast list/array data structures written in Rust with Python bindings.
16
+
Ulist is an ultra fast list/array data structure written in Rust with Python bindings. It aims to be the fundamental package for processing and computing 1-D list/array in Python.
17
+
It provides:
18
+
19
+
* an efficient, flexible and expressive 1-D list/array object;
20
+
* broadcasting methods;
21
+
* a SQL-like and method-chaining programming experience;
18
22
19
23
20
24
### Requirements
@@ -28,44 +32,51 @@ Run `pip install ulist`
28
32
29
33
### Examples
30
34
31
-
#### Calculate the average of unique numbers.
35
+
#### Count the number of items in bins.
36
+
Given an array `arr`, count the number of items in bins [0, 3), [3, 6), [6, 9) and [9, +inf). The `result` is a Python dictionary with bin names as keys and numbers as values.
Given two 1-D arrays and calculate the dot product result of those arrays.
42
57
```Python
43
-
import ulist as ul
44
-
45
-
arr1 = ul.arange(1, 4)
46
-
arr2 = ul.arange(1, 4)
47
-
result = arr1.mul(arr2).sum()
48
-
print(result)
49
-
```
58
+
>>>import ulist as ul
50
59
60
+
>>> arr = ul.from_seq(range(1, 4), dtype='float')
61
+
>>> arr
62
+
UltraFastList([1.0, 2.0, 3.0])
51
63
52
-
#### Subtract the mean from the list.
53
-
```Python
54
-
import ulist as ul
55
-
56
-
arr = ul.from_seq([1, 2, 3, 4, 5], dtype="float")
57
-
result = arr.sub_scala(arr.mean()).to_list()
58
-
print(result)
64
+
>>> result = arr.mul(arr).sum()
65
+
>>> result
66
+
14.0
59
67
```
60
68
61
-
62
-
#### Use operators instead of methods to calculate variance.
69
+
#### Rate of adults.
70
+
Given the ages of people as `arr`, and suppose the adults are equal or above 18. Clean the data by removing abnormal values and then calculate the rate of adults.
0 commit comments