Andrea Seveso commited on
Commit
db04e35
1 Parent(s): f574033

One level dataframe

Browse files
Files changed (1) hide show
  1. app.py +8 -6
app.py CHANGED
@@ -137,12 +137,14 @@ def get_macro_area_data():
137
 
138
  def get_question_format_data():
139
  dataset = pd.read_csv("src/question_format.csv", sep=',')
140
- top_level_headers = dataset.iloc[0]
141
- second_level_headers = dataset.columns
142
- multi_index = pd.MultiIndex.from_tuples(
143
- zip(top_level_headers, second_level_headers))
144
- dataset = dataset.iloc[1:]
145
- dataset.columns = multi_index
 
 
146
 
147
  # dataset = dataset.style.highlight_max(color='lightgreen', axis=0)
148
  return dataset
 
137
 
138
  def get_question_format_data():
139
  dataset = pd.read_csv("src/question_format.csv", sep=',')
140
+ top_level_headers = [
141
+ int(float(x)) if '.' in x else x for x in dataset.columns]
142
+ second_level_headers = dataset.iloc[0]
143
+ columns = [f'{x} - {y}' for x,
144
+ y in zip(top_level_headers, second_level_headers)]
145
+ dataset = dataset.iloc[2:]
146
+ columns[0] = 'Model'
147
+ dataset.columns = columns
148
 
149
  # dataset = dataset.style.highlight_max(color='lightgreen', axis=0)
150
  return dataset