Skip to content

Instantly share code, notes, and snippets.

@yosh1
Last active October 7, 2018 11:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yosh1/70e6967096175685ffa623a9cf873695 to your computer and use it in GitHub Desktop.
Save yosh1/70e6967096175685ffa623a9cf873695 to your computer and use it in GitHub Desktop.
Pythonで規則性のある数値を読み込み→行列に変換する方法 ref: https://qiita.com/yoshi1125hisa/items/682757cdbeb4502e6aca
1
2
3
4
5
6
7
8
9
1
2
3
4
5
6
7
8
9
1
2
3
4
5
6
7
8
9
...
1 1 1
2 2 2
3 3 3
4 4 4
5 5 5
6 6 6
7 7 7
8 8 8
9 9 9
...
import numpy as np
d = np.loadtxt('text.txt', dtype='int').reshape(-1,5).T
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment