Python में ETL और ELT
Jake Roach
Data Engineer

अधिकांश उत्पादित/उपयोग किया गया डेटा असंरचित होता है

API (Application Programming Interface)
$$

JSON (JavaScript Object Notation)
dictionaries जैसा{
"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