質問編集履歴

3

修正

2017/07/11 08:45

投稿

kohekoh
kohekoh

スコア140

test CHANGED
File without changes
test CHANGED
@@ -92,10 +92,8 @@
92
92
 
93
93
  {"user_id": "ZxdojCZgZhw36xuSGaryRg"
94
94
 
95
-
96
95
 
97
96
 
98
-
99
- ↑矢印の部分に空白があって、そこの部分でエラーがでているようです
97
+ id": "Zx の部分に空白があって、そこの部分でエラーがでているようです
100
98
 
101
99
  ここを無視するようなコード等ありませんか

2

さらに追記::

2017/07/11 08:45

投稿

kohekoh
kohekoh

スコア140

test CHANGED
@@ -1 +1 @@
1
- 追記pythonでjson読み込み
1
+ pythonでjson読み込み 空白を無視したい
test CHANGED
@@ -85,3 +85,17 @@
85
85
  ただ、微妙にjsonと違うというか、表現しにくいのですが
86
86
 
87
87
  理由あって、jsonloadではなく、jsonloadsで一行づつ読み込んでいます
88
+
89
+
90
+
91
+ -----さらに追記------
92
+
93
+ {"user_id": "ZxdojCZgZhw36xuSGaryRg"
94
+
95
+
96
+
97
+
98
+
99
+ ↑矢印の部分に空白があって、そこの部分でエラーがでているようです
100
+
101
+ ここを無視するようなコード等ありませんか

1

追記

2017/07/11 08:44

投稿

kohekoh
kohekoh

スコア140

test CHANGED
@@ -1 +1 @@
1
- pythonでjson読み込み
1
+ 追記pythonでjson読み込み
test CHANGED
@@ -55,3 +55,33 @@
55
55
  ```
56
56
 
57
57
  どうすればよいですか
58
+
59
+
60
+
61
+ -------追記---------
62
+
63
+ ```
64
+
65
+ {"user_id": "ZxdojCZgZhw36xuSGaryRg", "text": "Pizza is garbage. Hoagies are excellent.", "business_id": "5UmKMjUEUNdYWqANhGckJw", "likes": 0, "date": "2016-07-17", "type": "tip"}
66
+
67
+ {"user_id": "-6rEfobYjMxpUWLNxszaxQ", "text": "Don't waste your time.", "business_id": "cE27W9VPgO88Qxe4ol6y_g", "likes": 0, "date": "2013-04-18", "type": "tip"}
68
+
69
+ {"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"}
70
+
71
+ {"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"}
72
+
73
+ {"user_id": "xb6zEQCw9I-Gl0g06e1KsQ", "text": "Great drink specials!", "business_id": "KayYbHCt-RkbGcPdGOThNg", "likes": 0, "date": "2013-12-03", "type": "tip"}
74
+
75
+ {"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"}
76
+
77
+ {"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"}
78
+
79
+
80
+
81
+ ```
82
+
83
+ このような行が10万行ほどあります
84
+
85
+ ただ、微妙にjsonと違うというか、表現しにくいのですが
86
+
87
+ 理由あって、jsonloadではなく、jsonloadsで一行づつ読み込んでいます