【问题标题】:Is there a way to convert a big json file into csv format using python有没有办法使用 python 将一个大的 json 文件转换为 csv 格式
【发布时间】:2019-01-26 11:13:11
【问题描述】:

我有大约 7 GB 的 json 大数据,我想将其转换为 CSV 以便更好地理解数据。我的数据集中有多个 json 对象。

以下是我的数据的第一个对象。

{
    '_id': {
        '$oid': '575feb01aea6d60d0209eb98'
    },
    'user': {
        'profile_background_image_url': 'http://abs.twimg.com/images/themes/theme1/bg.png',
        'id': {
            '$numberLong': '3365483769'
        },
        'profile_link_color': '0084B4',
        'id_str': '3365483769',
        'lang': 'el',
        'created_at': 'Wed Jul 08 07:10:52 +0000 2015',
        'friends_count': 404,
        'profile_text_color': '333333',
        'profile_background_image_url_https': 'https://abs.twimg.com/images/themes/theme1/bg.png',
        'listed_count': 2,
        'profile_background_color': 'C0DEED',
        'profile_image_url_https': 'https://pbs.twimg.com/profile_images/742575018157182976/9Vq7CsJZ_normal.jpg',
        'default_profile': True,
        'screen_name': 'kottara2',
        'geo_enabled': True,
        'followers_count': 70,
        'name': 'Dr. ΑΝΤΡΕΑΣ',
        'statuses_count': 1008,
        'profile_image_url': 'http://pbs.twimg.com/profile_images/742575018157182976/9Vq7CsJZ_normal.jpg',
        'profile_sidebar_fill_color': 'DDEEF6',
        'profile_sidebar_border_color': 'C0DEED',
        'profile_use_background_image': True,
        'profile_banner_url': 'https://pbs.twimg.com/profile_banners/3365483769/1465878634',
        'favourites_count': 517
    },
    'place': {
        'bounding_box': {
            'coordinates': [
                [
                    [19.372958, 34.802021],
                    [19.372958, 41.748536],
                    [29.644764, 41.748536],
                    [29.644764, 34.802021]
                ]
            ],
            'type': 'Polygon'
        },
        'country_code': 'GR',
        'id': '2ee7eeaa84dbe65a',
        'name': 'Ελλάς',
        'url': 'https://api.twitter.com/1.1/geo/id/2ee7eeaa84dbe65a.json',
        'country': 'Ελλάς',
        'full_name': 'Ελλάς',
        'place_type': 'country'
    },
    'id': {
        '$numberLong': '742680788190257152'
    },
    'timestamp_ms': '1465903872903',
    'source': '<a href="http://twitter.com" rel="nofollow">Twitter Web Client</a>',
    'text': 'ΑΛΗΤΗ  ΤΣΙΠΡΑ  ΔΕΝ  ΕΧΕΙΣ  ΟΥΤΕ  ΤΣΙΠΑ  !!!',
    'filter_level': 'low',
    'id_str': '742680788190257152',
    'lang': 'el',
    'created_at': {
        '$date': '2016-06-14T11:31:12.000Z'
    }
}

我想要一个 .CSV 格式

【问题讨论】:

标签: python json csv


【解决方案1】:
猜你喜欢
  • 2012-05-03
  • 1970-01-01
  • 2020-01-10
  • 2019-03-31
  • 1970-01-01
  • 2016-11-06
  • 1970-01-01
  • 1970-01-01
  • 2020-01-14
相关资源
最近更新 更多