mmyjh86

[개인질문] 판다스/JSON 변환

Nov 22nd, 2019
140
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import pybithumb
  2. import pandas as pd
  3.  
  4. # DataFrame to Json
  5. df = pybithumb.get_ohlcv("BTC")
  6. data = df.to_json()
  7. print(data)
  8.  
  9. # Json to DataFrame
  10. df = pd.read_json(data)
  11. print(df.head())
RAW Paste Data