質問編集履歴
2
test
CHANGED
File without changes
|
test
CHANGED
@@ -172,6 +172,8 @@
|
|
172
172
|
|
173
173
|
を用いて置換したが同様のエラーが発生した。
|
174
174
|
|
175
|
+
パスを直接書き込む場合は失敗しない
|
176
|
+
|
175
177
|
|
176
178
|
|
177
179
|
### 補足情報(FW/ツールのバージョンなど)
|
1
エラーメッセージの記入漏れ修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -8,7 +8,111 @@
|
|
8
8
|
|
9
9
|
```
|
10
10
|
|
11
|
-
|
11
|
+
---------------------------------------------------------------------------
|
12
|
+
|
13
|
+
ValueError Traceback (most recent call last)
|
14
|
+
|
15
|
+
<ipython-input-3-365cc4cf31ce> in <module>
|
16
|
+
|
17
|
+
5
|
18
|
+
|
19
|
+
6 for filename in all_files:
|
20
|
+
|
21
|
+
----> 7 df = pd.read_json(filename, orient='records', lines=True)
|
22
|
+
|
23
|
+
8 li.append(df)
|
24
|
+
|
25
|
+
9
|
26
|
+
|
27
|
+
|
28
|
+
|
29
|
+
~\anaconda3\lib\site-packages\pandas\util\_decorators.py in wrapper(*args, **kwargs)
|
30
|
+
|
31
|
+
212 else:
|
32
|
+
|
33
|
+
213 kwargs[new_arg_name] = new_arg_value
|
34
|
+
|
35
|
+
--> 214 return func(*args, **kwargs)
|
36
|
+
|
37
|
+
215
|
38
|
+
|
39
|
+
216 return cast(F, wrapper)
|
40
|
+
|
41
|
+
|
42
|
+
|
43
|
+
~\anaconda3\lib\site-packages\pandas\io\json\_json.py in read_json(path_or_buf, orient, typ, dtype, convert_axes, convert_dates, keep_default_dates, numpy, precise_float, date_unit, encoding, lines, chunksize, compression)
|
44
|
+
|
45
|
+
606 return json_reader
|
46
|
+
|
47
|
+
607
|
48
|
+
|
49
|
+
--> 608 result = json_reader.read()
|
50
|
+
|
51
|
+
609 if should_close:
|
52
|
+
|
53
|
+
610 filepath_or_buffer.close()
|
54
|
+
|
55
|
+
|
56
|
+
|
57
|
+
~\anaconda3\lib\site-packages\pandas\io\json\_json.py in read(self)
|
58
|
+
|
59
|
+
727 elif self.lines:
|
60
|
+
|
61
|
+
728 data = ensure_str(self.data)
|
62
|
+
|
63
|
+
--> 729 obj = self._get_object_parser(self._combine_lines(data.split("\n")))
|
64
|
+
|
65
|
+
730 else:
|
66
|
+
|
67
|
+
731 obj = self._get_object_parser(self.data)
|
68
|
+
|
69
|
+
|
70
|
+
|
71
|
+
~\anaconda3\lib\site-packages\pandas\io\json\_json.py in _get_object_parser(self, json)
|
72
|
+
|
73
|
+
751 obj = None
|
74
|
+
|
75
|
+
752 if typ == "frame":
|
76
|
+
|
77
|
+
--> 753 obj = FrameParser(json, **kwargs).parse()
|
78
|
+
|
79
|
+
754
|
80
|
+
|
81
|
+
755 if typ == "series" or obj is None:
|
82
|
+
|
83
|
+
|
84
|
+
|
85
|
+
~\anaconda3\lib\site-packages\pandas\io\json\_json.py in parse(self)
|
86
|
+
|
87
|
+
855
|
88
|
+
|
89
|
+
856 else:
|
90
|
+
|
91
|
+
--> 857 self._parse_no_numpy()
|
92
|
+
|
93
|
+
858
|
94
|
+
|
95
|
+
859 if self.obj is None:
|
96
|
+
|
97
|
+
|
98
|
+
|
99
|
+
~\anaconda3\lib\site-packages\pandas\io\json\_json.py in _parse_no_numpy(self)
|
100
|
+
|
101
|
+
1106 else:
|
102
|
+
|
103
|
+
1107 self.obj = DataFrame(
|
104
|
+
|
105
|
+
-> 1108 loads(json, precise_float=self.precise_float), dtype=None
|
106
|
+
|
107
|
+
1109 )
|
108
|
+
|
109
|
+
1110
|
110
|
+
|
111
|
+
|
112
|
+
|
113
|
+
ValueError: No ':' found when decoding object value
|
114
|
+
|
115
|
+
|
12
116
|
|
13
117
|
```
|
14
118
|
|
@@ -32,7 +136,7 @@
|
|
32
136
|
|
33
137
|
for filename in all_files:
|
34
138
|
|
35
|
-
df = pd.read_json(filename
|
139
|
+
df = pd.read_json(filename, orient='records', lines=True)
|
36
140
|
|
37
141
|
li.append(df)
|
38
142
|
|