質問編集履歴
3
修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -64,6 +64,8 @@
|
|
64
64
|
|
65
65
|
出力内容は以下の様になりました。(途中まで)
|
66
66
|
|
67
|
+
2回目と3回目のprint1の出力箇所が中央列と右列の表示なっているのが問題です。value1は左列しか表示しない様にしていたのですが...
|
68
|
+
|
67
69
|
```ここに言語を入力
|
68
70
|
|
69
71
|
#print0 0
|
2
修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -12,17 +12,13 @@
|
|
12
12
|
|
13
13
|
df = pd.read_csv('analyze2.csv',header=None)
|
14
14
|
|
15
|
-
#print(df[1])
|
16
|
-
|
17
|
-
# value = df.iloc[0+1,0]
|
18
|
-
|
19
|
-
# print(df.iloc[0,0])
|
20
|
-
|
21
15
|
|
22
16
|
|
23
17
|
for i in range(0,66999):
|
24
18
|
|
25
19
|
value = df.iloc[i,0]#i行目の左列の取得
|
20
|
+
|
21
|
+
print('#print0',i)
|
26
22
|
|
27
23
|
print('#print1',value)
|
28
24
|
|
@@ -38,145 +34,75 @@
|
|
38
34
|
|
39
35
|
c += 1
|
40
36
|
|
41
|
-
method2 = df.iloc[i+c,1]
|
37
|
+
method2 = df.iloc[i+c,1] #i+c行目の中央列の取得
|
42
38
|
|
43
39
|
print('#print2')
|
44
40
|
|
45
|
-
|
41
|
+
print('#print3',c)
|
46
42
|
|
47
|
-
|
43
|
+
co = df.iloc[i+c] #i+c行目だけを取得
|
48
44
|
|
49
|
-
r
|
45
|
+
print('#print4')
|
50
46
|
|
51
|
-
df = pd.concat([
|
47
|
+
redf = pd.concat([df[0:i],co]) #結合(dfデータの0からi行目まで+取得した行列)
|
52
48
|
|
53
|
-
df.
|
49
|
+
df = pd.concat([redf,df[i+1:66999]]) #結合(redf+dfデータのi+1行目から最後の66999行目まで)
|
54
50
|
|
55
|
-
|
51
|
+
df.drop(i+c+1) #i+c+1行目のデータをnewdfから削除
|
56
52
|
|
57
|
-
# method2 = df.iloc[i+c,1] #i+c行目の中央列の取得
|
58
53
|
|
59
|
-
# # print(count)
|
60
|
-
|
61
|
-
# if method1 == method2:
|
62
|
-
|
63
|
-
# copy = df.copy(i+c) #i+c行目のデータをコピー
|
64
|
-
|
65
|
-
# #df.drop(i+c) #i+c行目のデータを元データから削除
|
66
|
-
|
67
|
-
# redf = pd.concat([df[:i],copy])#結合(dfデータのi行目まで+コピーした行列)
|
68
|
-
|
69
|
-
# df = pd.concat([redf,df[i+1:]])#結合(redf+dfデータのi+1行目以降)
|
70
|
-
|
71
|
-
# df.drop(i+c+1) #i+c+1行目のデータをnewdfから削除
|
72
|
-
|
73
|
-
# # print('if')
|
74
|
-
|
75
|
-
# else:
|
76
|
-
|
77
|
-
# # print('else')
|
78
|
-
|
79
|
-
# continue
|
80
|
-
|
81
|
-
# # print('BREAK!')
|
82
|
-
|
83
|
-
# break
|
84
54
|
|
85
55
|
else:
|
86
56
|
|
87
57
|
continue
|
88
58
|
|
89
|
-
print('#print
|
59
|
+
print('#print5')
|
90
60
|
|
91
61
|
|
92
62
|
|
93
63
|
```
|
94
64
|
|
95
|
-
出力内容は以下の様になりました。
|
65
|
+
出力内容は以下の様になりました。(途中まで)
|
96
66
|
|
97
67
|
```ここに言語を入力
|
98
68
|
|
69
|
+
#print0 0
|
70
|
+
|
99
71
|
#print1 1
|
100
72
|
|
101
|
-
#print3
|
73
|
+
#print3 1
|
102
74
|
|
103
75
|
#print4
|
104
76
|
|
77
|
+
#print5
|
78
|
+
|
79
|
+
#print0 1
|
80
|
+
|
81
|
+
#print1 convert orig/00000002.png -crop 1280x600+0+0 crop/00000002.png
|
82
|
+
|
83
|
+
#print0 2
|
84
|
+
|
85
|
+
#print1 1558070265.8343878
|
86
|
+
|
87
|
+
#print0 3
|
88
|
+
|
105
89
|
#print1 2
|
90
|
+
|
91
|
+
#print0 4
|
106
92
|
|
107
93
|
#print1 1
|
108
94
|
|
109
|
-
#print3
|
95
|
+
#print3 1
|
110
96
|
|
111
97
|
#print4
|
112
98
|
|
113
|
-
#print
|
99
|
+
#print5
|
114
100
|
|
115
|
-
#print
|
101
|
+
#print0 5
|
116
102
|
|
117
|
-
#print
|
103
|
+
#print1 convert orig/00000001.png -crop 1280x600+0+0 crop/00000001.png
|
118
104
|
|
119
|
-
#print4
|
120
105
|
|
121
|
-
#print1 2
|
122
|
-
|
123
|
-
#print1 1
|
124
|
-
|
125
|
-
#print3
|
126
|
-
|
127
|
-
#print4
|
128
|
-
|
129
|
-
#print1 2
|
130
|
-
|
131
|
-
#print1 1
|
132
|
-
|
133
|
-
#print3
|
134
|
-
|
135
|
-
#print4
|
136
|
-
|
137
|
-
#print1 2
|
138
|
-
|
139
|
-
#print1 1
|
140
|
-
|
141
|
-
#print3
|
142
|
-
|
143
|
-
#print4
|
144
|
-
|
145
|
-
#print1 2
|
146
|
-
|
147
|
-
#print1 1
|
148
|
-
|
149
|
-
#print3
|
150
|
-
|
151
|
-
#print4
|
152
|
-
|
153
|
-
#print1 2
|
154
|
-
|
155
|
-
#print1 1
|
156
|
-
|
157
|
-
#print3
|
158
|
-
|
159
|
-
#print4
|
160
|
-
|
161
|
-
#print1 2
|
162
|
-
|
163
|
-
#print1 1
|
164
|
-
|
165
|
-
#print3
|
166
|
-
|
167
|
-
#print4
|
168
|
-
|
169
|
-
#print1 2
|
170
|
-
|
171
|
-
#print1 1
|
172
|
-
|
173
|
-
#print3
|
174
|
-
|
175
|
-
#print4
|
176
|
-
|
177
|
-
#print1 2
|
178
|
-
|
179
|
-
#print1 1
|
180
106
|
|
181
107
|
|
182
108
|
|
1
修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -12,7 +12,7 @@
|
|
12
12
|
|
13
13
|
df = pd.read_csv('analyze2.csv',header=None)
|
14
14
|
|
15
|
-
print(df[1])
|
15
|
+
#print(df[1])
|
16
16
|
|
17
17
|
# value = df.iloc[0+1,0]
|
18
18
|
|
@@ -24,7 +24,7 @@
|
|
24
24
|
|
25
25
|
value = df.iloc[i,0]#i行目の左列の取得
|
26
26
|
|
27
|
-
print(value)
|
27
|
+
print('#print1',value)
|
28
28
|
|
29
29
|
if value == 1:
|
30
30
|
|
@@ -40,11 +40,11 @@
|
|
40
40
|
|
41
41
|
method2 = df.iloc[i+c,1]
|
42
42
|
|
43
|
-
print('
|
43
|
+
print('#print2')
|
44
44
|
|
45
45
|
copy = df.copy(i+c)
|
46
46
|
|
47
|
-
print('
|
47
|
+
print('#print3')
|
48
48
|
|
49
49
|
redf = pd.concat([df[:i],copy])
|
50
50
|
|
@@ -86,32 +86,98 @@
|
|
86
86
|
|
87
87
|
continue
|
88
88
|
|
89
|
-
print('
|
89
|
+
print('#print4')
|
90
|
-
|
91
|
-
# for s in range(0,67000):
|
92
|
-
|
93
|
-
# print(newdf.iloc[s,0])
|
94
|
-
|
95
|
-
pd.set_option('display.max_rows', 67000)
|
96
|
-
|
97
|
-
print(newdf)
|
98
90
|
|
99
91
|
|
100
92
|
|
101
93
|
```
|
102
94
|
|
103
|
-
|
95
|
+
出力内容は以下の様になりました。
|
104
|
-
|
105
|
-
printデバックを何箇所かにしてtest.txtに書き込む様にしているのですが、どこにも書き込まれていない状態です。
|
106
|
-
|
107
|
-
書き込み方は、
|
108
96
|
|
109
97
|
```ここに言語を入力
|
110
98
|
|
111
|
-
p
|
99
|
+
#print1 1
|
100
|
+
|
101
|
+
#print3
|
102
|
+
|
103
|
+
#print4
|
104
|
+
|
105
|
+
#print1 2
|
106
|
+
|
107
|
+
#print1 1
|
108
|
+
|
109
|
+
#print3
|
110
|
+
|
111
|
+
#print4
|
112
|
+
|
113
|
+
#print1 2
|
114
|
+
|
115
|
+
#print1 1
|
116
|
+
|
117
|
+
#print3
|
118
|
+
|
119
|
+
#print4
|
120
|
+
|
121
|
+
#print1 2
|
122
|
+
|
123
|
+
#print1 1
|
124
|
+
|
125
|
+
#print3
|
126
|
+
|
127
|
+
#print4
|
128
|
+
|
129
|
+
#print1 2
|
130
|
+
|
131
|
+
#print1 1
|
132
|
+
|
133
|
+
#print3
|
134
|
+
|
135
|
+
#print4
|
136
|
+
|
137
|
+
#print1 2
|
138
|
+
|
139
|
+
#print1 1
|
140
|
+
|
141
|
+
#print3
|
142
|
+
|
143
|
+
#print4
|
144
|
+
|
145
|
+
#print1 2
|
146
|
+
|
147
|
+
#print1 1
|
148
|
+
|
149
|
+
#print3
|
150
|
+
|
151
|
+
#print4
|
152
|
+
|
153
|
+
#print1 2
|
154
|
+
|
155
|
+
#print1 1
|
156
|
+
|
157
|
+
#print3
|
158
|
+
|
159
|
+
#print4
|
160
|
+
|
161
|
+
#print1 2
|
162
|
+
|
163
|
+
#print1 1
|
164
|
+
|
165
|
+
#print3
|
166
|
+
|
167
|
+
#print4
|
168
|
+
|
169
|
+
#print1 2
|
170
|
+
|
171
|
+
#print1 1
|
172
|
+
|
173
|
+
#print3
|
174
|
+
|
175
|
+
#print4
|
176
|
+
|
177
|
+
#print1 2
|
178
|
+
|
179
|
+
#print1 1
|
180
|
+
|
181
|
+
|
112
182
|
|
113
183
|
```
|
114
|
-
|
115
|
-
です。エラー自体は出ていないのでどこがいけないのか分からない状態です。
|
116
|
-
|
117
|
-
read.csvの直後のprintすら出力されていないので読み込みが問題あるのでしょうか..?
|