add co2 out

This commit is contained in:
赵敬皓 2023-06-29 15:00:30 +08:00
parent 9aaced60da
commit 4da597cb1e
2 changed files with 5 additions and 1 deletions

View File

@ -114,6 +114,10 @@ POST
947.7765892741911,
888.8596446324813
],
"co2": [
188.88,
256.99
]
"vocs": [
1023.5987164161264,
959.9684162030799

View File

@ -114,7 +114,7 @@ def predict_df(his_data, input_data:pd.DataFrame, model:lgb.Booster, object_cols
input_data_cp['pm10'] = input_data.apply(lambda x: cal_PM(x['0_c_smoke'], x['生产设备类型'], emission_factors.get('pm10')), axis=1)
assert 'coal' in input_data_cp.columns
input_data_cp['co2'] = input_data_cp.apply(lambda x: cal_CO2(x['coal'], x['低位发热量']), axis=1)
out_cols = ['company', 'unit', 'time', 'coal', 'co', 'vocs', 'pm25', 'pm10']
out_cols = ['company', 'unit', 'time', 'coal', 'co', 'vocs', 'co2', 'pm25', 'pm10']
rst = input_data_cp[out_cols].to_dict(orient='list')
return rst