質問編集履歴
3
修正
title
CHANGED
|
File without changes
|
body
CHANGED
|
@@ -45,7 +45,6 @@
|
|
|
45
45
|
|
|
46
46
|
-----さらに追記------
|
|
47
47
|
{"user_id": "ZxdojCZgZhw36xuSGaryRg"
|
|
48
|
-
↑
|
|
49
48
|
|
|
50
|
-
|
|
49
|
+
id": "Zx の部分に空白があって、そこの部分でエラーがでているようです
|
|
51
50
|
ここを無視するようなコード等ありませんか
|
2
さらに追記::
title
CHANGED
|
@@ -1,1 +1,1 @@
|
|
|
1
|
-
|
|
1
|
+
pythonでjson読み込み 空白を無視したい
|
body
CHANGED
|
@@ -41,4 +41,11 @@
|
|
|
41
41
|
```
|
|
42
42
|
このような行が10万行ほどあります
|
|
43
43
|
ただ、微妙にjsonと違うというか、表現しにくいのですが
|
|
44
|
-
理由あって、jsonloadではなく、jsonloadsで一行づつ読み込んでいます
|
|
44
|
+
理由あって、jsonloadではなく、jsonloadsで一行づつ読み込んでいます
|
|
45
|
+
|
|
46
|
+
-----さらに追記------
|
|
47
|
+
{"user_id": "ZxdojCZgZhw36xuSGaryRg"
|
|
48
|
+
↑
|
|
49
|
+
|
|
50
|
+
↑矢印の部分に空白があって、そこの部分でエラーがでているようです
|
|
51
|
+
ここを無視するようなコード等ありませんか
|
1
追記
title
CHANGED
|
@@ -1,1 +1,1 @@
|
|
|
1
|
-
pythonでjson読み込み
|
|
1
|
+
追記pythonでjson読み込み
|
body
CHANGED
|
@@ -26,4 +26,19 @@
|
|
|
26
26
|
a.append([json_dict["user_id"],json_dict["business_id"],json_dict["text"]])
|
|
27
27
|
ful.close()
|
|
28
28
|
```
|
|
29
|
-
どうすればよいですか
|
|
29
|
+
どうすればよいですか
|
|
30
|
+
|
|
31
|
+
-------追記---------
|
|
32
|
+
```
|
|
33
|
+
{"user_id": "ZxdojCZgZhw36xuSGaryRg", "text": "Pizza is garbage. Hoagies are excellent.", "business_id": "5UmKMjUEUNdYWqANhGckJw", "likes": 0, "date": "2016-07-17", "type": "tip"}
|
|
34
|
+
{"user_id": "-6rEfobYjMxpUWLNxszaxQ", "text": "Don't waste your time.", "business_id": "cE27W9VPgO88Qxe4ol6y_g", "likes": 0, "date": "2013-04-18", "type": "tip"}
|
|
35
|
+
{"user_id": "5OumCBQ_MyQsltSdbMyunA", "text": "Not easy to find. Be sure to put in directions for Rankin Police Department or you will end up at a residential home on the wrong Hawkins Ave. Found it after the third try. Also, it closes at 7pm.", "business_id": "mVHrayjG3uZ_RLHkLj-AMg", "likes": 0, "date": "2016-02-22", "type": "tip"}
|
|
36
|
+
{"user_id": "EZ0r9dKKtEGVx2CdnowPCw", "text": "Your GPS will not allow you to find this place. Put Rankin police department in instead. They are directly across the street.", "business_id": "mVHrayjG3uZ_RLHkLj-AMg", "likes": 1, "date": "2013-01-06", "type": "tip"}
|
|
37
|
+
{"user_id": "xb6zEQCw9I-Gl0g06e1KsQ", "text": "Great drink specials!", "business_id": "KayYbHCt-RkbGcPdGOThNg", "likes": 0, "date": "2013-12-03", "type": "tip"}
|
|
38
|
+
{"user_id": "QawZN4PSW7ng_9SP7pjsVQ", "text": "Friendly staff, good food, great beer selection, and relaxing atmosphere", "business_id": "KayYbHCt-RkbGcPdGOThNg", "likes": 0, "date": "2015-07-08", "type": "tip"}
|
|
39
|
+
{"user_id": "8K8qHAH9AREKxIIZAwQ9Fg", "text": "Fantastic! Great food, excellent beer selection! Bartenders are great!", "business_id": "KayYbHCt-RkbGcPdGOThNg", "likes": 0, "date": "2016-02-18", "type": "tip"}
|
|
40
|
+
|
|
41
|
+
```
|
|
42
|
+
このような行が10万行ほどあります
|
|
43
|
+
ただ、微妙にjsonと違うというか、表現しにくいのですが
|
|
44
|
+
理由あって、jsonloadではなく、jsonloadsで一行づつ読み込んでいます
|