Python으로 ETL과 ELT
Jake Roach
Data Engineer

생성·소비되는 데이터의 대부분은 비정형 데이터

API (Application Programming Interface)
$$

JSON (JavaScript Object Notation)
dict(딕셔너리)와 유사한 형태{
"key": "value",
...
"open": 0.121875
}
{
"timestamps": [863703000, 863789400, ...],
"open": [0.121875, 0.098438, ...],
"close": [...],
"volume": [...]
}
.read_json() 함수 사용
# Read in a JSON file in the format above
raw_stock_data = pd.read_json("raw_stock_data.json", orient="columns")
데이터가 항상 DataFrame 형태는 아님
{
"863703000": {
"volume": 1443120000,
"price": {
"close": 0.09791,
"open": 0.12187
}
},
"863789400": {
...
}, ...
}
import json
with open("raw_stock_data.json", "r") as file:
# Load the file into a dictionary
raw_stock_data = json.load(file)
# Confirm the type of the raw_stock_data variable
print(type(raw_stock_data))
<class 'dict'>
Python으로 ETL과 ELT