python
1import json 2a = open('sample5.json') 3b = json.load(a) 4 5print(b)
{'version': 1.3, 'people': [{'person_id': [-1], 'pose_keypoints_2d': [587.949, 239.939, 0.839375, 507.121, 290.011, 0.837855, 526.698, 289.994, 0.820984, 568.426, 404.105, 0.816751, 632.363, 340.047, 0.764949, 484.846, 289.969, 0.746806, 368.048, 340.206, 0.884581, 412.415, 448.766, 0.86027, 498.761, 507.183, 0.658267, 482.21, 510.006, 0.684794, 409.729, 677.088, 0.867163, 259.443, 821.802, 0.619658, 515.573, 507.132, 0.54484, 671.386, 590.617, 0.857604, 579.596, 721.524, 0.660342, 582.265, 223.271, 0.801545, 0, 0, 0, 546.15, 223.279, 0.858325, 0, 0, 0, 565.632, 766.112, 0.396978, 590.729, 771.611, 0.502286, 551.715, 729.922, 0.497523, 259.376, 863.52, 0.300194, 237.161, 844.039, 0.293003, 239.884, 830.054, 0.467987], 'face_keypoints_2d': [], 'hand_left_keypoints_2d': [], 'hand_right_keypoints_2d': [], 'pose_keypoints_3d': [], 'face_keypoints_3d': [], 'hand_left_keypoints_3d': [], 'hand_right_keypoints_3d': []}]}
このようなjsonファイルをCSVに変換したいのですが、上手く出来ません。pythonを使ってCSVファイルに変換できる方法を教えて頂けないでしょうか?
あなたの回答
tips
プレビュー