質問編集履歴
4
pandasのデータ読み込みに関して
title
CHANGED
File without changes
|
body
CHANGED
@@ -54,5 +54,5 @@
|
|
54
54
|
回答いただき、ありがとうございます!
|
55
55
|
いただいた回答をもとに変更したのですが、下記のように表示されてしまいます。
|
56
56
|
無知で大変申し訳ございませんが解決方法を教えていただくことはできますでしょうか。
|
57
|
-

|
58
58
|

|
3
pandasのデータ読み込みに関して
title
CHANGED
File without changes
|
body
CHANGED
@@ -51,104 +51,8 @@
|
|
51
51
|
```
|
52
52
|
また読み込むCSVファイルは下記の通りです。
|
53
53
|
|
54
|
-
x,y
|
55
|
-
|
54
|
+
回答いただき、ありがとうございます!
|
56
|
-
40.68600000000001,132500.0
|
57
|
-
38.43,93000.0
|
58
|
-
36.822,96500.0
|
59
|
-
37.002,100500.0
|
60
|
-
35.106,97500.0
|
61
|
-
35.016000000000005,97500.0
|
62
|
-
36.762,102000.0
|
63
|
-
38.844,99000.0
|
64
|
-
37.374,97000.0
|
65
|
-
37.17,108500.0
|
66
|
-
40.29,114000.0
|
67
|
-
35.477999999999994,94000.0
|
68
|
-
36.55200000000001,93500.0
|
69
|
-
37.524,92500.0
|
70
|
-
35.568,91500.0
|
71
|
-
37.056,106000.0
|
72
|
-
36.126,96000.0
|
73
|
-
|
55
|
+
いただいた回答をもとに変更したのですが、下記のように表示されてしまいます。
|
74
|
-
34.385999999999996,96500.0
|
75
|
-
35.22,110000.0
|
76
|
-
36.024,101500.0
|
77
|
-
|
56
|
+
無知で大変申し訳ございませんが解決方法を教えていただくことはできますでしょうか。
|
78
|
-
35.135999999999996,86500.0
|
79
|
-
35.274,94000.0
|
80
|
-
35.916000000000004,107000.0
|
81
|
-
33.678,78500.0
|
82
|
-
34.158,81000.0
|
83
|
-
38.586,90000.0
|
84
|
-
33.822,71500.0
|
85
|
-
38.748,96000.0
|
86
|
-
37.956,98000.0
|
87
|
-
38.232000000000006,115000.0
|
88
|
-
34.932,92000.0
|
89
|
-
34.542,78000.0
|
90
|
-
38.01,90500.0
|
91
|
-
35.652,87000.0
|
92
|
-
38.724,85500.0
|
93
|
-
35.142,66500.0
|
94
|
-
36.906,89000.0
|
95
|
-
37.044,70000.0
|
96
|
-
30.114,72000.0
|
97
|
-
32.418,67000.0
|
98
|
-
32.808,78000.0
|
99
|
-
29.418000000000003,59000.0
|
100
|
-
36.78,69000.0
|
101
|
-
33.767999999999994,78000.0
|
102
|
-
29.556,73000.0
|
103
|
-
31.116,89000.0
|
104
|
-
33.582,77000.0
|
105
|
-
36.732000000000006,107500.0
|
106
|
-
32.424,98000.0
|
107
|
-
|
57
|
+

|
108
|
-
34.254,97000.0
|
109
|
-
36.774,85000.0
|
110
|
-
36.912,78000.0
|
111
|
-
31.632,65500.0
|
112
|
-
41.658,206500.0
|
113
|
-
36.396,121500.0
|
114
|
-
39.06,116500.0
|
115
|
-
37.5,135000.0
|
116
|
-
44.934,250000.0
|
117
|
-
46.812000000000005,250000.0
|
118
|
-
50.25,250000.0
|
119
|
-
35.124,113500.0
|
120
|
-
36.606,125000.0
|
121
|
-
47.574,250000.0
|
122
|
-
35.262,119000.0
|
123
|
-
37.914,119000.0
|
124
|
-
38.412,111500.0
|
125
|
-
35.25,87000.0
|
126
|
-
35.28,95500.0
|
127
|
-
33.432,115500.0
|
128
|
-
38.496,118000.0
|
129
|
-
35.153999999999996,113000.0
|
130
|
-
39.276,147000.0
|
131
|
-
36.12,116000.0
|
132
|
-
37.89,123000.0
|
133
|
-
41.160000000000004,149500.0
|
134
|
-
41.88,186000.0
|
135
|
-
46.589999999999996,199000.0
|
136
|
-
36.864000000000004,181000.0
|
137
|
-
42.93,189500.0
|
138
|
-
39.378,162500.0
|
139
|
-
33.624,132000.0
|
140
|
-
36.918,148000.0
|
141
|
-
46.986000000000004,250000.0
|
142
|
-
40.692,160000.0
|
143
|
-
39.336,149000.0
|
144
|
-
43.11,174500.0
|
145
|
-
41.706,185000.0
|
146
|
-
40.434,152500.0
|
147
|
-
43.068,182000.0
|
148
|
-
40.8,155500.0
|
149
|
-
39.624,145500.0
|
150
|
-
47.25,250000.0
|
151
|
-
43.72200000000001,166500.0
|
152
|
-
42.642,151500.0
|
153
|
-
43.644,173000.0
|
154
|
-
|
58
|
+

|
2
エラーコードの添付及びCSVファイルの送付に関して
title
CHANGED
File without changes
|
body
CHANGED
@@ -1,8 +1,54 @@
|
|
1
1
|
pythonでのpandasにてcsvファイルを読み込むことができずに困っています。
|
2
2
|
以下のようなエラーコードが表示されるのですが、どのように解決すればよろしいでしょうか。
|
3
|
+
```---------------------------------------------------------------------------
|
4
|
+
FileNotFoundError Traceback (most recent call last)
|
3
|
-
|
5
|
+
<ipython-input-17-1a9ccd469d55> in <module>
|
6
|
+
1 # CSVファイルの読み込み
|
7
|
+
2 # df: data frame
|
4
|
-
|
8
|
+
----> 3 df = pd.read_csv('sample.csv')
|
5
9
|
|
10
|
+
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)
|
11
|
+
674 )
|
12
|
+
675
|
13
|
+
--> 676 return _read(filepath_or_buffer, kwds)
|
14
|
+
677
|
15
|
+
678 parser_f.__name__ = name
|
16
|
+
|
17
|
+
C:\Anaconda2\lib\site-packages\pandas\io\parsers.py in _read(filepath_or_buffer, kwds)
|
18
|
+
446
|
19
|
+
447 # Create the parser.
|
20
|
+
--> 448 parser = TextFileReader(fp_or_buf, **kwds)
|
21
|
+
449
|
22
|
+
450 if chunksize or iterator:
|
23
|
+
|
24
|
+
C:\Anaconda2\lib\site-packages\pandas\io\parsers.py in __init__(self, f, engine, **kwds)
|
25
|
+
878 self.options["has_index_names"] = kwds["has_index_names"]
|
26
|
+
879
|
27
|
+
--> 880 self._make_engine(self.engine)
|
28
|
+
881
|
29
|
+
882 def close(self):
|
30
|
+
|
31
|
+
C:\Anaconda2\lib\site-packages\pandas\io\parsers.py in _make_engine(self, engine)
|
32
|
+
1112 def _make_engine(self, engine="c"):
|
33
|
+
1113 if engine == "c":
|
34
|
+
-> 1114 self._engine = CParserWrapper(self.f, **self.options)
|
35
|
+
1115 else:
|
36
|
+
1116 if engine == "python":
|
37
|
+
|
38
|
+
C:\Anaconda2\lib\site-packages\pandas\io\parsers.py in __init__(self, src, **kwds)
|
39
|
+
1889 kwds["usecols"] = self.usecols
|
40
|
+
1890
|
41
|
+
-> 1891 self._reader = parsers.TextReader(src, **kwds)
|
42
|
+
1892 self.unnamed_cols = self._reader.unnamed_cols
|
43
|
+
1893
|
44
|
+
|
45
|
+
pandas\_libs\parsers.pyx in pandas._libs.parsers.TextReader.__cinit__()
|
46
|
+
|
47
|
+
pandas\_libs\parsers.pyx in pandas._libs.parsers.TextReader._setup_parser_source()
|
48
|
+
|
49
|
+
FileNotFoundError: [Errno 2] File sample.csv does not exist: 'sample.csv'
|
50
|
+
コード
|
51
|
+
```
|
6
52
|
また読み込むCSVファイルは下記の通りです。
|
7
53
|
|
8
54
|
x,y
|
1
エラー内容のすべての表示およびCSVファイルの添付に関して
title
CHANGED
File without changes
|
body
CHANGED
@@ -1,2 +1,108 @@
|
|
1
1
|
pythonでのpandasにてcsvファイルを読み込むことができずに困っています。
|
2
|
-
以下のようなエラーコードが表示されるのですが、どのように解決すればよろしいでしょうか。
|
2
|
+
以下のようなエラーコードが表示されるのですが、どのように解決すればよろしいでしょうか。
|
3
|
+
修正したものを添付しております。
|
4
|
+

|
5
|
+
|
6
|
+
また読み込むCSVファイルは下記の通りです。
|
7
|
+
|
8
|
+
x,y
|
9
|
+
40.362,137500.0
|
10
|
+
40.68600000000001,132500.0
|
11
|
+
38.43,93000.0
|
12
|
+
36.822,96500.0
|
13
|
+
37.002,100500.0
|
14
|
+
35.106,97500.0
|
15
|
+
35.016000000000005,97500.0
|
16
|
+
36.762,102000.0
|
17
|
+
38.844,99000.0
|
18
|
+
37.374,97000.0
|
19
|
+
37.17,108500.0
|
20
|
+
40.29,114000.0
|
21
|
+
35.477999999999994,94000.0
|
22
|
+
36.55200000000001,93500.0
|
23
|
+
37.524,92500.0
|
24
|
+
35.568,91500.0
|
25
|
+
37.056,106000.0
|
26
|
+
36.126,96000.0
|
27
|
+
35.232000000000006,102000.0
|
28
|
+
34.385999999999996,96500.0
|
29
|
+
35.22,110000.0
|
30
|
+
36.024,101500.0
|
31
|
+
35.766000000000005,102500.0
|
32
|
+
35.135999999999996,86500.0
|
33
|
+
35.274,94000.0
|
34
|
+
35.916000000000004,107000.0
|
35
|
+
33.678,78500.0
|
36
|
+
34.158,81000.0
|
37
|
+
38.586,90000.0
|
38
|
+
33.822,71500.0
|
39
|
+
38.748,96000.0
|
40
|
+
37.956,98000.0
|
41
|
+
38.232000000000006,115000.0
|
42
|
+
34.932,92000.0
|
43
|
+
34.542,78000.0
|
44
|
+
38.01,90500.0
|
45
|
+
35.652,87000.0
|
46
|
+
38.724,85500.0
|
47
|
+
35.142,66500.0
|
48
|
+
36.906,89000.0
|
49
|
+
37.044,70000.0
|
50
|
+
30.114,72000.0
|
51
|
+
32.418,67000.0
|
52
|
+
32.808,78000.0
|
53
|
+
29.418000000000003,59000.0
|
54
|
+
36.78,69000.0
|
55
|
+
33.767999999999994,78000.0
|
56
|
+
29.556,73000.0
|
57
|
+
31.116,89000.0
|
58
|
+
33.582,77000.0
|
59
|
+
36.732000000000006,107500.0
|
60
|
+
32.424,98000.0
|
61
|
+
30.071999999999996,76500.0
|
62
|
+
34.254,97000.0
|
63
|
+
36.774,85000.0
|
64
|
+
36.912,78000.0
|
65
|
+
31.632,65500.0
|
66
|
+
41.658,206500.0
|
67
|
+
36.396,121500.0
|
68
|
+
39.06,116500.0
|
69
|
+
37.5,135000.0
|
70
|
+
44.934,250000.0
|
71
|
+
46.812000000000005,250000.0
|
72
|
+
50.25,250000.0
|
73
|
+
35.124,113500.0
|
74
|
+
36.606,125000.0
|
75
|
+
47.574,250000.0
|
76
|
+
35.262,119000.0
|
77
|
+
37.914,119000.0
|
78
|
+
38.412,111500.0
|
79
|
+
35.25,87000.0
|
80
|
+
35.28,95500.0
|
81
|
+
33.432,115500.0
|
82
|
+
38.496,118000.0
|
83
|
+
35.153999999999996,113000.0
|
84
|
+
39.276,147000.0
|
85
|
+
36.12,116000.0
|
86
|
+
37.89,123000.0
|
87
|
+
41.160000000000004,149500.0
|
88
|
+
41.88,186000.0
|
89
|
+
46.589999999999996,199000.0
|
90
|
+
36.864000000000004,181000.0
|
91
|
+
42.93,189500.0
|
92
|
+
39.378,162500.0
|
93
|
+
33.624,132000.0
|
94
|
+
36.918,148000.0
|
95
|
+
46.986000000000004,250000.0
|
96
|
+
40.692,160000.0
|
97
|
+
39.336,149000.0
|
98
|
+
43.11,174500.0
|
99
|
+
41.706,185000.0
|
100
|
+
40.434,152500.0
|
101
|
+
43.068,182000.0
|
102
|
+
40.8,155500.0
|
103
|
+
39.624,145500.0
|
104
|
+
47.25,250000.0
|
105
|
+
43.72200000000001,166500.0
|
106
|
+
42.642,151500.0
|
107
|
+
43.644,173000.0
|
108
|
+
41.849999999999994,174500.0
|