-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaggregate_per_aircraft.py
40 lines (33 loc) · 1.41 KB
/
aggregate_per_aircraft.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import pandas as pd
def calculate():
# Load Data and only keep relevant Parameters
aircrafts = pd.read_excel(r'Databank.xlsx')
aircrafts = aircrafts[['Company',
'Name',
'Type',
'YOI',
'MTOW,integer,kilogram',
'MZFW,integer,kilogram',
'Exit Limit',
'Fuel capacity,integer,litre',
'TSFC Cruise',
'Engine Efficiency',
'EU (MJ/ASK)',
'OEW/Exit Limit',
'L/D estimate',
'Aspect Ratio',
'k',
'Wingspan,float,metre',
'prop_eff',
'thermal_eff',
'c_L',
'c_D',
'c_Di',
'c_D0',
'Pax',
'Height,float,metre',
'B/P Ratio',
'Overcome Thrust']]
aircrafts = aircrafts.groupby(['Company','Name','Type','YOI'], as_index=False).agg('mean')
aircrafts.to_excel(r'Databank.xlsx', index=False)
aircrafts.to_excel(r'dashboard/data/Databank.xlsx', index=False)