iiabm-core/risk_analysis_count.py

9 lines
264 B
Python
Raw Normal View History

2023-09-10 22:35:48 +08:00
import pandas as pd
count = pd.read_csv("output_result\\risk\\count.csv",
dtype={'s_id': str, 'id_firm': str})
print(count)
print(len(count['s_id'].unique()))
count_max_ts = count.groupby('s_id')['ts'].max()
print(count_max_ts.value_counts())