Phân tích báo cáo tài chính bằng Python
Rohan Chatterjee
Risk Modeler
JSON (JavaScript Object Notation)JSON JSON vào Python bằng pandascash_flow = pd.read_json("cash_flow_statement.json")
print(cash_flow.head())

Tỷ trọng dòng tiền từ hoạt động kinh doanh so với lợi nhuận ròng
Hoạt động kinh doanh là hoạt động cốt lõi của doanh nghiệp
Tỷ số cao cho thấy doanh nghiệp tạo nhiều tiền từ hoạt động cốt lõi
Công thức:
$$\dfrac{\text{Cash flow from operating activities}}{\text{Net income}}$$
Công thức:
$$\dfrac{\text{Cash flow from operating activities}}{\text{Current liabilities}}$$
dataset hiển thị, một số mục của "Total Current Liabilities" bị thiếu, được đánh dấu bằng NaN
imputation = dataset.groupby("company")["Total Current Liabilities"].transform("mean")
dataset["Imputed Total Current Liabilities"] = dataset["Total Current Liabilities"].fillna(imputation)
dataset trông như sau:
Nội suy giá trị thiếu bằng phân vị 70 của các giá trị không thiếu (trường hợp xấu hơn) sẽ cho kết quả thận trọng hơn.
Tính tỷ số với nội suy thận trọng hơn có thể phù hợp hơn nếu tỷ số dùng để ra quyết định.
company:imputation = dataset.groupby("company")["Total Current Liabilities"]\
.transform(lambda x: np.nanquantile(x, 0.7))
dataset["Imputed Total Current Liabilities"] = dataset["Total Current Liabilities"]\
.fillna(imputation)
Phân tích báo cáo tài chính bằng Python