質問編集履歴
4
追記しました、解決1を
test
CHANGED
File without changes
|
test
CHANGED
@@ -113,3 +113,65 @@
|
|
113
113
|
|
114
114
|
|
115
115
|
ちなみにgoogle colaboratory使っており、ColabでDriveにuploadする方法が知りたいです。
|
116
|
+
|
117
|
+
|
118
|
+
|
119
|
+
```python
|
120
|
+
|
121
|
+
from google.colab import drive
|
122
|
+
|
123
|
+
drive.mount('/content/drive')
|
124
|
+
|
125
|
+
|
126
|
+
|
127
|
+
sys.path.append('/content/drive/My Drive')
|
128
|
+
|
129
|
+
|
130
|
+
|
131
|
+
!pip install -U -q PyDrive
|
132
|
+
|
133
|
+
|
134
|
+
|
135
|
+
from pydrive.auth import GoogleAuth
|
136
|
+
|
137
|
+
from pydrive.drive import GoogleDrive
|
138
|
+
|
139
|
+
from google.colab import auth
|
140
|
+
|
141
|
+
from oauth2client.client import GoogleCredentials
|
142
|
+
|
143
|
+
|
144
|
+
|
145
|
+
auth.authenticate_user()
|
146
|
+
|
147
|
+
gauth = GoogleAuth()
|
148
|
+
|
149
|
+
gauth.credentials = GoogleCredentials.get_application_default()
|
150
|
+
|
151
|
+
drive = GoogleDrive(gauth)
|
152
|
+
|
153
|
+
|
154
|
+
|
155
|
+
a = [[1,2,3],[4,5,6],[7,8,9]]
|
156
|
+
|
157
|
+
f = open("/tmp/hoge.csv", mode="w")
|
158
|
+
|
159
|
+
f.write("\n".join([",".join(map(str,b)) for b in a]))
|
160
|
+
|
161
|
+
|
162
|
+
|
163
|
+
upload_file_2 = drive.CreateFile()
|
164
|
+
|
165
|
+
upload_file_2.SetContentFile("/tmp/hoge.csv")
|
166
|
+
|
167
|
+
upload_file_2.Upload()
|
168
|
+
|
169
|
+
|
170
|
+
|
171
|
+
f.close()
|
172
|
+
|
173
|
+
```
|
174
|
+
|
175
|
+
|
176
|
+
|
177
|
+
こうですかね?もっと軽量化する方法あります?
|
3
追記しましたー。
test
CHANGED
File without changes
|
test
CHANGED
@@ -112,4 +112,4 @@
|
|
112
112
|
|
113
113
|
|
114
114
|
|
115
|
-
ちなみにgoogle colaboratory使って
|
115
|
+
ちなみにgoogle colaboratory使っており、ColabでDriveにuploadする方法が知りたいです。
|
2
補足致しました。
test
CHANGED
File without changes
|
test
CHANGED
@@ -109,3 +109,7 @@
|
|
109
109
|
2・・・10
|
110
110
|
|
111
111
|
と、こんな感じですね。
|
112
|
+
|
113
|
+
|
114
|
+
|
115
|
+
ちなみにgoogle colaboratory使ってます。
|
1
追記致しました。
test
CHANGED
File without changes
|
test
CHANGED
@@ -80,4 +80,32 @@
|
|
80
80
|
|
81
81
|
|
82
82
|
|
83
|
-
こんな感じで作成したtraining_data_listを
|
83
|
+
こんな感じで作成したtraining_data_listの数値データを書き込んだ、まぁできればcsvファイルで保存したいのですが、
|
84
|
+
|
85
|
+
|
86
|
+
|
87
|
+
具体的には、
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,84,185,159,151,60,36,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,222,254,254,254,254,241,198,198,198,198,198,198,198,198,170,52,0,0,0,0,0,0,0,0,0,0,0,0,67,114,72,114,163,227,254,225,254,254,254,250,229,254,254,140,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,17,66,14,67,67,67,59,21,236,254,106,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,83,253,209,18,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,22,233,255,83,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,129,254,238,44,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,59,249,254,62,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,133,254,187,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,9,205,248,58,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,126,254,182,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,75,251,240,57,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,19,221,254,166,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,203,254,219,35,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38,254,254,77,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,31,224,254,115,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,133,254,254,52,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,61,242,254,254,52,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,121,254,254,219,40,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,121,254,207,18,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
92
|
+
|
93
|
+
2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,116,125,171,255,255,150,93,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,169,253,253,253,253,253,253,218,30,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,169,253,253,253,213,142,176,253,253,122,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,250,253,210,32,12,0,6,206,253,140,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,77,251,210,25,0,0,0,122,248,253,65,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,31,18,0,0,0,0,209,253,253,65,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,117,247,253,198,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,76,247,253,231,63,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,253,253,144,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,176,246,253,159,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,25,234,253,233,35,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,198,253,253,141,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,78,248,253,189,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,19,200,253,253,141,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,253,253,173,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,248,253,253,25,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,248,253,253,43,20,20,20,20,5,0,5,20,20,37,150,150,150,147,10,0,0,0,0,0,0,0,0,0,248,253,253,253,253,253,253,253,168,143,166,253,253,253,253,253,253,253,123,0,0,0,0,0,0,0,0,0,174,253,253,253,253,253,253,253,253,253,253,253,249,247,247,169,117,117,57,0,0,0,0,0,0,0,0,0,0,118,123,123,123,166,253,253,253,155,123,123,41,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
94
|
+
|
95
|
+
1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38,254,109,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,87,252,82,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,135,241,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,45,244,150,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
96
|
+
|
97
|
+
こんな感じで、数字を,区切りで、束にして一行ずつ・・・。
|
98
|
+
|
99
|
+
束にするのは、1リストごと、例えば、traininglistが
|
100
|
+
|
101
|
+
[[0, 10, 4, 2, 4, 4, 4, 4, 4, 4, 8, 10, 4, 2, 2, 6, 6, 2, 2, 4, 10], [1, 10, 8, 5, 5, 7, 7, 8, 7, 3, 4, 10, 10, 6, 6, 1, 1, 3, 8, 9, 10], [2, 10, 4, 3, 8, 7, 6, 6, 7, 2, 2, 10, 6, 5, 4, 3, 3, 2, 4, 8, 10]]
|
102
|
+
|
103
|
+
であれば(実際そうなんですが)、
|
104
|
+
|
105
|
+
0,10,4,2,4,4,4,4,4,4,8,10,4,2,2,6,6,2,2,4,10
|
106
|
+
|
107
|
+
1,10,8,5,5,7,7,8,7,3,4,10,10,6,6,1,1,3,8,9,10
|
108
|
+
|
109
|
+
2・・・10
|
110
|
+
|
111
|
+
と、こんな感じですね。
|