質問編集履歴

4

pandasのデータ読み込みに関して

2020/09/16 01:22

投稿

fumiya-damo
fumiya-damo

スコア1

test CHANGED
File without changes
test CHANGED
@@ -110,6 +110,6 @@
110
110
 
111
111
  無知で大変申し訳ございませんが解決方法を教えていただくことはできますでしょうか。
112
112
 
113
- ![イメージ説明](478e911ecb9572826327da077a5d5a59.png)
113
+ ![イメージ説明](52f18061f39f303219c6827c605adea4.png)
114
114
 
115
115
  ![イメージ説明](7fa3f1f7b8f4c8ef9c93cdaf799ca2bc.png)

3

pandasのデータ読み込みに関して

2020/09/16 01:22

投稿

fumiya-damo
fumiya-damo

スコア1

test CHANGED
File without changes
test CHANGED
@@ -104,204 +104,12 @@
104
104
 
105
105
 
106
106
 
107
- x,y
107
+ 回答いただき、ありがとうございます!
108
108
 
109
- 40.362,137500.0
109
+ いただいた回答をもとに変更したのですが、下記のように表示されてしまいます。
110
110
 
111
- 40.68600000000001,132500.0
111
+ 無知で大変申し訳ございませんが解決方法を教えていただくことはできますでしょうか。
112
112
 
113
- 38.43,93000.0
113
+ ![イメージ説明](478e911ecb9572826327da077a5d5a59.png)
114
114
 
115
- 36.822,96500.0
116
-
117
- 37.002,100500.0
118
-
119
- 35.106,97500.0
120
-
121
- 35.016000000000005,97500.0
122
-
123
- 36.762,102000.0
124
-
125
- 38.844,99000.0
126
-
127
- 37.374,97000.0
128
-
129
- 37.17,108500.0
130
-
131
- 40.29,114000.0
132
-
133
- 35.477999999999994,94000.0
134
-
135
- 36.55200000000001,93500.0
136
-
137
- 37.524,92500.0
138
-
139
- 35.568,91500.0
140
-
141
- 37.056,106000.0
142
-
143
- 36.126,96000.0
144
-
145
- 35.232000000000006,102000.0
146
-
147
- 34.385999999999996,96500.0
148
-
149
- 35.22,110000.0
150
-
151
- 36.024,101500.0
152
-
153
- 35.766000000000005,102500.0
154
-
155
- 35.135999999999996,86500.0
156
-
157
- 35.274,94000.0
158
-
159
- 35.916000000000004,107000.0
160
-
161
- 33.678,78500.0
162
-
163
- 34.158,81000.0
164
-
165
- 38.586,90000.0
166
-
167
- 33.822,71500.0
168
-
169
- 38.748,96000.0
170
-
171
- 37.956,98000.0
172
-
173
- 38.232000000000006,115000.0
174
-
175
- 34.932,92000.0
176
-
177
- 34.542,78000.0
178
-
179
- 38.01,90500.0
180
-
181
- 35.652,87000.0
182
-
183
- 38.724,85500.0
184
-
185
- 35.142,66500.0
186
-
187
- 36.906,89000.0
188
-
189
- 37.044,70000.0
190
-
191
- 30.114,72000.0
192
-
193
- 32.418,67000.0
194
-
195
- 32.808,78000.0
196
-
197
- 29.418000000000003,59000.0
198
-
199
- 36.78,69000.0
200
-
201
- 33.767999999999994,78000.0
202
-
203
- 29.556,73000.0
204
-
205
- 31.116,89000.0
206
-
207
- 33.582,77000.0
208
-
209
- 36.732000000000006,107500.0
210
-
211
- 32.424,98000.0
212
-
213
- 30.071999999999996,76500.0
214
-
215
- 34.254,97000.0
216
-
217
- 36.774,85000.0
218
-
219
- 36.912,78000.0
220
-
221
- 31.632,65500.0
222
-
223
- 41.658,206500.0
224
-
225
- 36.396,121500.0
226
-
227
- 39.06,116500.0
228
-
229
- 37.5,135000.0
230
-
231
- 44.934,250000.0
232
-
233
- 46.812000000000005,250000.0
234
-
235
- 50.25,250000.0
236
-
237
- 35.124,113500.0
238
-
239
- 36.606,125000.0
240
-
241
- 47.574,250000.0
242
-
243
- 35.262,119000.0
244
-
245
- 37.914,119000.0
246
-
247
- 38.412,111500.0
248
-
249
- 35.25,87000.0
250
-
251
- 35.28,95500.0
252
-
253
- 33.432,115500.0
254
-
255
- 38.496,118000.0
256
-
257
- 35.153999999999996,113000.0
258
-
259
- 39.276,147000.0
260
-
261
- 36.12,116000.0
262
-
263
- 37.89,123000.0
264
-
265
- 41.160000000000004,149500.0
266
-
267
- 41.88,186000.0
268
-
269
- 46.589999999999996,199000.0
270
-
271
- 36.864000000000004,181000.0
272
-
273
- 42.93,189500.0
274
-
275
- 39.378,162500.0
276
-
277
- 33.624,132000.0
278
-
279
- 36.918,148000.0
280
-
281
- 46.986000000000004,250000.0
282
-
283
- 40.692,160000.0
284
-
285
- 39.336,149000.0
286
-
287
- 43.11,174500.0
288
-
289
- 41.706,185000.0
290
-
291
- 40.434,152500.0
292
-
293
- 43.068,182000.0
294
-
295
- 40.8,155500.0
296
-
297
- 39.624,145500.0
298
-
299
- 47.25,250000.0
300
-
301
- 43.72200000000001,166500.0
302
-
303
- 42.642,151500.0
304
-
305
- 43.644,173000.0
306
-
307
- 41.849999999999994,174500.0
115
+ ![イメージ説明](7fa3f1f7b8f4c8ef9c93cdaf799ca2bc.png)

2

エラーコードの添付及びCSVファイルの送付に関して

2020/09/16 00:21

投稿

fumiya-damo
fumiya-damo

スコア1

test CHANGED
File without changes
test CHANGED
@@ -2,11 +2,103 @@
2
2
 
3
3
  以下のようなエラーコードが表示されるのですが、どのように解決すればよろしいでしょうか。
4
4
 
5
- 修正したものを添付しております。![イメージ説明](d4257cd97badc440dfb07067034f53fb.png)
6
-
7
- ![イメージ説明](cd454046098accbabee53bd3730895c8.png)
8
-
9
-
5
+ ```---------------------------------------------------------------------------
6
+
7
+ FileNotFoundError Traceback (most recent call last)
8
+
9
+ <ipython-input-17-1a9ccd469d55> in <module>
10
+
11
+ 1 # CSVファイルの読み込み
12
+
13
+ 2 # df: data frame
14
+
15
+ ----> 3 df = pd.read_csv('sample.csv')
16
+
17
+
18
+
19
+ C:\Anaconda2\lib\site-packages\pandas\io\parsers.py in parser_f(filepath_or_buffer, sep, delimiter, header, names, index_col, usecols, squeeze, prefix, mangle_dupe_cols, dtype, engine, converters, true_values, false_values, skipinitialspace, skiprows, skipfooter, nrows, na_values, keep_default_na, na_filter, verbose, skip_blank_lines, parse_dates, infer_datetime_format, keep_date_col, date_parser, dayfirst, cache_dates, iterator, chunksize, compression, thousands, decimal, lineterminator, quotechar, quoting, doublequote, escapechar, comment, encoding, dialect, error_bad_lines, warn_bad_lines, delim_whitespace, low_memory, memory_map, float_precision)
20
+
21
+ 674 )
22
+
23
+ 675
24
+
25
+ --> 676 return _read(filepath_or_buffer, kwds)
26
+
27
+ 677
28
+
29
+ 678 parser_f.__name__ = name
30
+
31
+
32
+
33
+ C:\Anaconda2\lib\site-packages\pandas\io\parsers.py in _read(filepath_or_buffer, kwds)
34
+
35
+ 446
36
+
37
+ 447 # Create the parser.
38
+
39
+ --> 448 parser = TextFileReader(fp_or_buf, **kwds)
40
+
41
+ 449
42
+
43
+ 450 if chunksize or iterator:
44
+
45
+
46
+
47
+ C:\Anaconda2\lib\site-packages\pandas\io\parsers.py in __init__(self, f, engine, **kwds)
48
+
49
+ 878 self.options["has_index_names"] = kwds["has_index_names"]
50
+
51
+ 879
52
+
53
+ --> 880 self._make_engine(self.engine)
54
+
55
+ 881
56
+
57
+ 882 def close(self):
58
+
59
+
60
+
61
+ C:\Anaconda2\lib\site-packages\pandas\io\parsers.py in _make_engine(self, engine)
62
+
63
+ 1112 def _make_engine(self, engine="c"):
64
+
65
+ 1113 if engine == "c":
66
+
67
+ -> 1114 self._engine = CParserWrapper(self.f, **self.options)
68
+
69
+ 1115 else:
70
+
71
+ 1116 if engine == "python":
72
+
73
+
74
+
75
+ C:\Anaconda2\lib\site-packages\pandas\io\parsers.py in __init__(self, src, **kwds)
76
+
77
+ 1889 kwds["usecols"] = self.usecols
78
+
79
+ 1890
80
+
81
+ -> 1891 self._reader = parsers.TextReader(src, **kwds)
82
+
83
+ 1892 self.unnamed_cols = self._reader.unnamed_cols
84
+
85
+ 1893
86
+
87
+
88
+
89
+ pandas\_libs\parsers.pyx in pandas._libs.parsers.TextReader.__cinit__()
90
+
91
+
92
+
93
+ pandas\_libs\parsers.pyx in pandas._libs.parsers.TextReader._setup_parser_source()
94
+
95
+
96
+
97
+ FileNotFoundError: [Errno 2] File sample.csv does not exist: 'sample.csv'
98
+
99
+ コード
100
+
101
+ ```
10
102
 
11
103
  また読み込むCSVファイルは下記の通りです。
12
104
 

1

エラー内容のすべての表示およびCSVファイルの添付に関して

2020/09/15 15:28

投稿

fumiya-damo
fumiya-damo

スコア1

test CHANGED
File without changes
test CHANGED
@@ -1,3 +1,215 @@
1
1
  pythonでのpandasにてcsvファイルを読み込むことができずに困っています。
2
2
 
3
- 以下のようなエラーコードが表示されるのですが、どのように解決すればよろしいでしょうか。![イメージ説明](3d46dad92c6b972269fe8f4d66033f67.png)
3
+ 以下のようなエラーコードが表示されるのですが、どのように解決すればよろしいでしょうか。
4
+
5
+ 修正したものを添付しております。![イメージ説明](d4257cd97badc440dfb07067034f53fb.png)
6
+
7
+ ![イメージ説明](cd454046098accbabee53bd3730895c8.png)
8
+
9
+
10
+
11
+ また読み込むCSVファイルは下記の通りです。
12
+
13
+
14
+
15
+ x,y
16
+
17
+ 40.362,137500.0
18
+
19
+ 40.68600000000001,132500.0
20
+
21
+ 38.43,93000.0
22
+
23
+ 36.822,96500.0
24
+
25
+ 37.002,100500.0
26
+
27
+ 35.106,97500.0
28
+
29
+ 35.016000000000005,97500.0
30
+
31
+ 36.762,102000.0
32
+
33
+ 38.844,99000.0
34
+
35
+ 37.374,97000.0
36
+
37
+ 37.17,108500.0
38
+
39
+ 40.29,114000.0
40
+
41
+ 35.477999999999994,94000.0
42
+
43
+ 36.55200000000001,93500.0
44
+
45
+ 37.524,92500.0
46
+
47
+ 35.568,91500.0
48
+
49
+ 37.056,106000.0
50
+
51
+ 36.126,96000.0
52
+
53
+ 35.232000000000006,102000.0
54
+
55
+ 34.385999999999996,96500.0
56
+
57
+ 35.22,110000.0
58
+
59
+ 36.024,101500.0
60
+
61
+ 35.766000000000005,102500.0
62
+
63
+ 35.135999999999996,86500.0
64
+
65
+ 35.274,94000.0
66
+
67
+ 35.916000000000004,107000.0
68
+
69
+ 33.678,78500.0
70
+
71
+ 34.158,81000.0
72
+
73
+ 38.586,90000.0
74
+
75
+ 33.822,71500.0
76
+
77
+ 38.748,96000.0
78
+
79
+ 37.956,98000.0
80
+
81
+ 38.232000000000006,115000.0
82
+
83
+ 34.932,92000.0
84
+
85
+ 34.542,78000.0
86
+
87
+ 38.01,90500.0
88
+
89
+ 35.652,87000.0
90
+
91
+ 38.724,85500.0
92
+
93
+ 35.142,66500.0
94
+
95
+ 36.906,89000.0
96
+
97
+ 37.044,70000.0
98
+
99
+ 30.114,72000.0
100
+
101
+ 32.418,67000.0
102
+
103
+ 32.808,78000.0
104
+
105
+ 29.418000000000003,59000.0
106
+
107
+ 36.78,69000.0
108
+
109
+ 33.767999999999994,78000.0
110
+
111
+ 29.556,73000.0
112
+
113
+ 31.116,89000.0
114
+
115
+ 33.582,77000.0
116
+
117
+ 36.732000000000006,107500.0
118
+
119
+ 32.424,98000.0
120
+
121
+ 30.071999999999996,76500.0
122
+
123
+ 34.254,97000.0
124
+
125
+ 36.774,85000.0
126
+
127
+ 36.912,78000.0
128
+
129
+ 31.632,65500.0
130
+
131
+ 41.658,206500.0
132
+
133
+ 36.396,121500.0
134
+
135
+ 39.06,116500.0
136
+
137
+ 37.5,135000.0
138
+
139
+ 44.934,250000.0
140
+
141
+ 46.812000000000005,250000.0
142
+
143
+ 50.25,250000.0
144
+
145
+ 35.124,113500.0
146
+
147
+ 36.606,125000.0
148
+
149
+ 47.574,250000.0
150
+
151
+ 35.262,119000.0
152
+
153
+ 37.914,119000.0
154
+
155
+ 38.412,111500.0
156
+
157
+ 35.25,87000.0
158
+
159
+ 35.28,95500.0
160
+
161
+ 33.432,115500.0
162
+
163
+ 38.496,118000.0
164
+
165
+ 35.153999999999996,113000.0
166
+
167
+ 39.276,147000.0
168
+
169
+ 36.12,116000.0
170
+
171
+ 37.89,123000.0
172
+
173
+ 41.160000000000004,149500.0
174
+
175
+ 41.88,186000.0
176
+
177
+ 46.589999999999996,199000.0
178
+
179
+ 36.864000000000004,181000.0
180
+
181
+ 42.93,189500.0
182
+
183
+ 39.378,162500.0
184
+
185
+ 33.624,132000.0
186
+
187
+ 36.918,148000.0
188
+
189
+ 46.986000000000004,250000.0
190
+
191
+ 40.692,160000.0
192
+
193
+ 39.336,149000.0
194
+
195
+ 43.11,174500.0
196
+
197
+ 41.706,185000.0
198
+
199
+ 40.434,152500.0
200
+
201
+ 43.068,182000.0
202
+
203
+ 40.8,155500.0
204
+
205
+ 39.624,145500.0
206
+
207
+ 47.25,250000.0
208
+
209
+ 43.72200000000001,166500.0
210
+
211
+ 42.642,151500.0
212
+
213
+ 43.644,173000.0
214
+
215
+ 41.849999999999994,174500.0