質問編集履歴

1

情報の追加

2018/11/09 11:22

投稿

taiyo2017
taiyo2017

スコア170

test CHANGED
File without changes
test CHANGED
@@ -25,3 +25,35 @@
25
25
  この行がおかしいと言われます。
26
26
 
27
27
  何が原因なのでしょうか?
28
+
29
+
30
+
31
+ Datasetクラスは、
32
+
33
+ ```ここに言語を入力
34
+
35
+ class Dataset():
36
+
37
+ def __init__(self, file, root_dir, small=False):
38
+
39
+ self.df = pd.read_csv(root_dir + file)
40
+
41
+
42
+
43
+ def __len__(self):
44
+
45
+ return len(self.df)
46
+
47
+
48
+
49
+ def __getitem__(self, id):
50
+
51
+ a = self.df["A"][id]
52
+
53
+ b = np.array(self.df.values[id][1])
54
+
55
+ return a, b
56
+
57
+ ```
58
+
59
+ のようなクラスです。