質問編集履歴
1
コードを編集
test
CHANGED
File without changes
|
test
CHANGED
@@ -25,3 +25,45 @@
|
|
25
25
|
dataヘッダーの列に[]がついたまま数値を記入してあるために、
|
26
26
|
|
27
27
|
うまく要素数をカウントできません
|
28
|
+
|
29
|
+
|
30
|
+
|
31
|
+
以下現在のコードです
|
32
|
+
|
33
|
+
```python
|
34
|
+
|
35
|
+
import pandas as pd
|
36
|
+
|
37
|
+
import json
|
38
|
+
|
39
|
+
import io
|
40
|
+
|
41
|
+
import numpy as np
|
42
|
+
|
43
|
+
import csv
|
44
|
+
|
45
|
+
|
46
|
+
|
47
|
+
for i in range(0,3):
|
48
|
+
|
49
|
+
with open('d'+str(i)+'.csv') as f:
|
50
|
+
|
51
|
+
da = f.read()
|
52
|
+
|
53
|
+
df = pd.read_csv(io.StringIO(da))
|
54
|
+
|
55
|
+
for j in range(0,4):
|
56
|
+
|
57
|
+
df2 = df[(df["number"]==j)]
|
58
|
+
|
59
|
+
df2 = df2.reset_index()
|
60
|
+
|
61
|
+
l=df2["Data"]
|
62
|
+
|
63
|
+
print(l1)
|
64
|
+
|
65
|
+
print(len(l1))
|
66
|
+
|
67
|
+
print(sum(len(v) for v in l))
|
68
|
+
|
69
|
+
```
|