vault backup: 2023-11-09 14:57:27

This commit is contained in:
2023-11-09 14:57:27 +08:00
parent fa6e1745e4
commit 237cf1ce15
2 changed files with 17 additions and 7 deletions

View File

@@ -0,0 +1,10 @@
如果多個array的順序有相關性我們要用同樣的順序來打亂他們可以用以下方法
```python
array1 = np.array([[1, 1], [2, 2], [3, 3]])
array2 = np.array([1, 2, 3])
shuffler = np.random.permutation(len(array1))
array1_shuffled = array1[shuffler]
array2_shuffled = array2[shuffler]
```