28
35

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Python PandasでJSONファイルをCSVファイルに変換する方法

Last updated at Posted at 2017-07-11

データ分析の仕事をしている時に容量のでかいJSONファイルをCSVに変換しないといけないことがあり、色々と調べてみたけど簡単に変換できる方法がないな~と思ってたらPandasが3行で解決してくれたのでメモ。
##Python PandasでJSON→CSV変換

changer.py
#Pandasをインポート
import pandas as pd

#変換したいJSONファイルを読み込む
df = pd.read_json("hogehoge.json")

#CSVに変換して任意のファイル名で保存
df.to_csv("hogehoge.csv")

これだけで終わり。Pandasほんと便利。

28
35
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
28
35

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?