Spaces:
Runtime error
Runtime error
Corey Morris
commited on
Commit
·
cee6ea9
1
Parent(s):
903d653
transposing data
Browse files
app.py
CHANGED
|
@@ -33,6 +33,9 @@ data2_df.index = data2_df.index.str.replace('hendrycksTest-', '')
|
|
| 33 |
# Merge the dataframes on index (Here index is the sub-test names)
|
| 34 |
data = pd.merge(data1_df[column_name_1], data2_df[column_name_2], left_index=True, right_index=True)
|
| 35 |
|
|
|
|
|
|
|
|
|
|
| 36 |
def show_leaderboard():
|
| 37 |
# Convert dataframe to html so that it can be displayed properly in Gradio
|
| 38 |
return data.to_html()
|
|
@@ -41,4 +44,4 @@ iface = gr.Interface(fn=show_leaderboard, inputs=[], outputs="html")
|
|
| 41 |
|
| 42 |
# Run the interface.
|
| 43 |
# Note: you don't need to use .launch() in Hugging Face Spaces, this is for local testing.
|
| 44 |
-
iface.launch()
|
|
|
|
| 33 |
# Merge the dataframes on index (Here index is the sub-test names)
|
| 34 |
data = pd.merge(data1_df[column_name_1], data2_df[column_name_2], left_index=True, right_index=True)
|
| 35 |
|
| 36 |
+
# Transpose the dataframe to swap rows and columns
|
| 37 |
+
data = data.transpose()
|
| 38 |
+
|
| 39 |
def show_leaderboard():
|
| 40 |
# Convert dataframe to html so that it can be displayed properly in Gradio
|
| 41 |
return data.to_html()
|
|
|
|
| 44 |
|
| 45 |
# Run the interface.
|
| 46 |
# Note: you don't need to use .launch() in Hugging Face Spaces, this is for local testing.
|
| 47 |
+
iface.launch()
|