`Python脚本,用于接收此JSON数据并将其转换为数据表
`下面是JSON数据
{"inappproduct": [{"packageName": "game",
"sku": "game_product1",
"status": "active",
"purchaseType": "managedUser",
"defaultPrice": {"priceMicros": "69990000", "currency": "CAD"},
"prices": {"DZ": {"priceMicros": "6325000000", "currency": "DZD"},
"AU": {"priceMicros": "79990000", "currency": "AUD"},
"CA": {"priceMicros": "69990000", "currency": "CAD"},
"IT": {"priceMicros": "54990000", "currency": "EUR"},
"JP": {"priceMicros": "6000000000", "currency": "JPY"},
"RU": {"priceMicros": "3790000000", "currency": "RUB"},
"SG": {"priceMicros": "68980000", "currency": "SGD"},
"KR": {"priceMicros": "65000000000", "currency": "KRW"},
"GB": {"priceMicros": "48990000", "currency": "GBP"},
"US": {"priceMicros": "49990000", "currency": "USD"},
"listings": {"en-US": {"title": "currency_1",
"description": "In-game currency"}},
"defaultLanguage": "en-US"}},
{"packageName": "game",
"sku": "game_bundle1",
"status": "active",
"purchaseType": "managedUser",
"defaultPrice": {"priceMicros": "139990000", "currency": "CAD"},
"prices": {"DZ": {"priceMicros": "12750000000", "currency": "DZD"},
"AU": {"priceMicros": "159990000", "currency": "AUD"},
"CA": {"priceMicros": "139990000", "currency": "CAD"},
"IT": {"priceMicros": "109990000", "currency": "EUR"},
"JP": {"priceMicros": "11800000000", "currency": "JPY"},
"RU": {"priceMicros": "7490000000", "currency": "RUB"},
"SG": {"priceMicros": "148980000", "currency": "SGD"},
"KR": {"priceMicros": "130000000000", "currency": "KRW"},
"GB": {"priceMicros": "99990000", "currency": "GBP"},
"US": {"priceMicros": "99990000", "currency": "USD"},
"listings": {"en-US": {"title": "bundle",
"description": "In-game bundle"}},
"defaultLanguage": "en-US"}}]}
The following are some considerations:
●可以从JSON键“packageName”中找到packageName列
● The column sku can be found from the JSON key “sku”
●列countryCode可以从包含两个-
letter country codes nested within the JSON key “prices”
●列currency可以从JSON键“currency”中找到
`●列价格可从JSON键“priceMicros”中找到。价格
等于“priceMicros”除以1000000。你知道吗
`the result should look like below
packageName sku countryCode currency price
game game_product1 CA CAD 69.99
game game_product1 US USD 48.99
. . . . .
. . . . .
. . . . .
game game_bundle1 GB GBP 99.99
我会使用
pandas
和列表理解,所以安装pandas
包 如果你还没有安装。你知道吗我会给你的“JSON数据”起个名字。你知道吗
然后:
相关问题 更多 >
编程相关推荐