Skip to content

Instantly share code, notes, and snippets.

@tetlabo
Created April 21, 2021 13:58
Show Gist options
  • Save tetlabo/daf433978bc4bae6a6ec2b1cb31ba299 to your computer and use it in GitHub Desktop.
Save tetlabo/daf433978bc4bae6a6ec2b1cb31ba299 to your computer and use it in GitHub Desktop.
AmbientWeather.netからデータを取得し、Pandasデータフレームに格納する
from ambient_api.ambientapi import AmbientAPI
import time
import pandas as pd
api = AmbientAPI(AMBIENT_API_KEY='your-key-here',AMBIENT_APPLICATION_KEY='your-key-here')
devices = api.get_devices()
device = devices[0]
time.sleep(1) # APIの制限を回避するため、1秒待つ
# データを取得し、Pandasデータフレームに格納する
df = pd.DataFrame.from_dict(device.get_data())
df.head()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment