回答編集履歴

1

Update

2022/05/25 02:18

投稿

melian
melian

スコア19798

test CHANGED
@@ -1,12 +1,14 @@
1
- array の中身0 〜 8 の整数値という限定条件付きであれば以下の様に(line plot ではありませんが)。
1
+ array の要素全て正値(positive value)であれば以下の様に(line plot ではありませんが)。
2
2
  ```python
3
3
  import numpy as np
4
4
 
5
- data = np.random.randint(0, 9, 5)
5
+ data = np.random.rand(10)*100
6
+ print(data)
6
- print(' '.join(' ▁▂▃▄▅▆▇█'[v] for v in data))
7
+ print(' '.join(' ▁▂▃▄▅▆▇█'[v] for v in (data*8/data.max()).astype(int)))
7
8
 
8
9
  #
10
+ array([46.4640353 , 94.05812779, 18.60159835, 98.51166869, 88.11051619,
11
+ 39.16486225, 42.13142329, 87.18723017, 43.24268532, 82.71649299])
9
12
 
10
- ▇ █
13
+ ▃ ▇ ▃ ▆
11
14
  ```
12
-