python-misc-utils 0.2__py3-none-any.whl → 0.22__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- py_misc_utils/np_utils.py +4 -10
- py_misc_utils/num_utils.py +6 -0
- {python_misc_utils-0.2.dist-info → python_misc_utils-0.22.dist-info}/METADATA +15 -1
- {python_misc_utils-0.2.dist-info → python_misc_utils-0.22.dist-info}/RECORD +7 -7
- {python_misc_utils-0.2.dist-info → python_misc_utils-0.22.dist-info}/WHEEL +1 -1
- {python_misc_utils-0.2.dist-info → python_misc_utils-0.22.dist-info}/licenses/LICENSE +0 -0
- {python_misc_utils-0.2.dist-info → python_misc_utils-0.22.dist-info}/top_level.txt +0 -0
py_misc_utils/np_utils.py
CHANGED
|
@@ -115,16 +115,6 @@ def is_numpy(v):
|
|
|
115
115
|
return type(v).__module__ == np.__name__
|
|
116
116
|
|
|
117
117
|
|
|
118
|
-
def is_sorted(data, descending=False):
|
|
119
|
-
if not isinstance(data, np.ndarray):
|
|
120
|
-
data = np.array(data)
|
|
121
|
-
|
|
122
|
-
if descending:
|
|
123
|
-
return np.all(data[:-1] >= data[1:])
|
|
124
|
-
|
|
125
|
-
return np.all(data[:-1] <= data[1:])
|
|
126
|
-
|
|
127
|
-
|
|
128
118
|
def astype(data, col, dtype):
|
|
129
119
|
if cu.isdict(dtype):
|
|
130
120
|
cdtype = dtype.get(col)
|
|
@@ -180,6 +170,10 @@ def normalize(data, axis=None):
|
|
|
180
170
|
return (data - mean) / std
|
|
181
171
|
|
|
182
172
|
|
|
173
|
+
def hasher(value):
|
|
174
|
+
return hash((value.dtype, tuple(value.shape), value.tobytes()))
|
|
175
|
+
|
|
176
|
+
|
|
183
177
|
def moving_average(data, window, include_current=True):
|
|
184
178
|
weights = np.ones(window, dtype=data.dtype) / window
|
|
185
179
|
pdata = np.pad(data, (window, window), mode='edge')
|
py_misc_utils/num_utils.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: python_misc_utils
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.22
|
|
4
4
|
Summary: A collection of Python utility APIs
|
|
5
5
|
Author: Davide Libenzi
|
|
6
6
|
License-Expression: Apache-2.0
|
|
@@ -34,3 +34,17 @@ Dynamic: summary
|
|
|
34
34
|
I keep writing the same stuff in different projects, so I finally decided
|
|
35
35
|
to throw stuff into a common boilerplate and stop the cut&paste jobs.
|
|
36
36
|
|
|
37
|
+
## Install
|
|
38
|
+
|
|
39
|
+
The library can be installed using *PyPi*:
|
|
40
|
+
|
|
41
|
+
```Shell
|
|
42
|
+
$ pip install python-misc-utils
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Or directly from the *Github* repository:
|
|
46
|
+
|
|
47
|
+
```Shell
|
|
48
|
+
$ pip install git+https://github.com/davidel/py_misc_utils.git
|
|
49
|
+
```
|
|
50
|
+
|
|
@@ -59,9 +59,9 @@ py_misc_utils/named_array.py,sha256=U_QnvediPoW4DIurAYc1Z5EDPcZEjKU3ABnjUM2S3Hc,
|
|
|
59
59
|
py_misc_utils/no_break.py,sha256=Yh6k469xV7eEjDTmaEqoY6o1IZUX8zVk2BNUfly2QUU,960
|
|
60
60
|
py_misc_utils/no_except.py,sha256=DjY88OtR6Y6lVlSY8SDhM1QkiK0dnZkYDTMk8WRTwMg,755
|
|
61
61
|
py_misc_utils/np_ml_framework.py,sha256=WZfNP5cEBQqbm4yaXIKatsshR4UmR-cOMTAW4ADbFdw,4433
|
|
62
|
-
py_misc_utils/np_utils.py,sha256=
|
|
62
|
+
py_misc_utils/np_utils.py,sha256=lHzSEgYag8jx0SmX_fSGmQY3RCzbqf0oHTJ3EYWK9SU,7681
|
|
63
63
|
py_misc_utils/ntuple_utils.py,sha256=a_kdVknrsdtK9PYSkgNcecMsdWcW9SF0T7NtQZr8bNc,1227
|
|
64
|
-
py_misc_utils/num_utils.py,sha256=
|
|
64
|
+
py_misc_utils/num_utils.py,sha256=cGAFme_IXTAnP0NwdOrrAYQDCnss3XwqtZS1hFxN-Tw,864
|
|
65
65
|
py_misc_utils/obj.py,sha256=udKD7gPDT-SosCuuQA5l5CCJsuYlrF60-TN1VRVlCg4,1430
|
|
66
66
|
py_misc_utils/object_cache.py,sha256=P5ZUg2QomouLEyfAx2mbhYcMi92CqQemVpMaFqSvpwY,2373
|
|
67
67
|
py_misc_utils/object_tracker.py,sha256=RLG6ob5FBHpXGB2PLW7IpfB4ZWehA7uX1YAjaRoD184,2208
|
|
@@ -110,8 +110,8 @@ py_misc_utils/fs/ftp_fs.py,sha256=qOLYQEg_6pqKC5YzICgEdOH9maomJtMv8c3exEY8BLE,63
|
|
|
110
110
|
py_misc_utils/fs/gcs_fs.py,sha256=4dfWa_4nqy9Q-HqEnuhMgkmk8z1NLiymY1WkP-90WCo,5100
|
|
111
111
|
py_misc_utils/fs/http_fs.py,sha256=6mQifdI50OQFd2d8yIfU0J3YYXC4yUVk-Wcz7uA0vvk,7040
|
|
112
112
|
py_misc_utils/fs/s3_fs.py,sha256=RAhUQf1tjLyTeeu1NqsLHn_HXPouCqbOd3-tYsjkec4,11492
|
|
113
|
-
python_misc_utils-0.
|
|
114
|
-
python_misc_utils-0.
|
|
115
|
-
python_misc_utils-0.
|
|
116
|
-
python_misc_utils-0.
|
|
117
|
-
python_misc_utils-0.
|
|
113
|
+
python_misc_utils-0.22.dist-info/licenses/LICENSE,sha256=djKp2doA3Fnx8LziguL9FWzCoGczXLbj_87qtbywYQI,555
|
|
114
|
+
python_misc_utils-0.22.dist-info/METADATA,sha256=nw5iH71eXG79oN6WgTcNcNenhD2-K3vaOVlQ1Kl8pdk,1383
|
|
115
|
+
python_misc_utils-0.22.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
|
|
116
|
+
python_misc_utils-0.22.dist-info/top_level.txt,sha256=Hqg8W5M7VvZLd-TlUDZLkZyaKat_Tf6OSx8IKAQC7t0,14
|
|
117
|
+
python_misc_utils-0.22.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|