Last active
June 20, 2017 13:10
-
-
Save northface/4bf33e2ea76f6d0fdb39bf090f13ff58 to your computer and use it in GitHub Desktop.
手元にあったFitbitの心拍データの読み込み
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import matplotlib.pyplot as plt | |
import pandas as pd | |
import glob | |
%matplotlib inline | |
csv_files_hr = glob.glob('HR/*.json') | |
heart_df = pd.DataFrame() | |
for f in csv_files_hr: | |
hr = pd.read_json(f,typ='series') | |
hr.to_dict() | |
date = pd.DataFrame.from_dict(hr['activities-heart']).dateTime[0] | |
temp = pd.DataFrame.from_dict(hr['activities-heart-intraday']['dataset']) | |
temp.index = pd.to_datetime([date + " " + t for t in temp.time]) | |
heart_df = pd.concat([heart_df,temp]) | |
heart_df.plot(y="value", figsize=(20,5)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment