Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,11 +1,12 @@
|
|
| 1 |
import streamlit as st
|
| 2 |
import pandas as pd
|
| 3 |
|
|
|
|
| 4 |
def display_csv(file_path, columns_to_display):
|
| 5 |
# Load the CSV file using pandas
|
| 6 |
df = pd.read_csv(file_path)
|
| 7 |
# Select only the specified columns
|
| 8 |
-
df_selected_columns = df[columns_to_display].sort_values(by=['avg_score']).reset_index(drop=True)
|
| 9 |
# Display the selected columns as a table
|
| 10 |
st.dataframe(df_selected_columns, height=500, width=1000)
|
| 11 |
|
|
@@ -38,4 +39,4 @@ def main():
|
|
| 38 |
""", unsafe_allow_html=True)
|
| 39 |
|
| 40 |
if __name__ == "__main__":
|
| 41 |
-
main()
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
import pandas as pd
|
| 3 |
|
| 4 |
+
|
| 5 |
def display_csv(file_path, columns_to_display):
|
| 6 |
# Load the CSV file using pandas
|
| 7 |
df = pd.read_csv(file_path)
|
| 8 |
# Select only the specified columns
|
| 9 |
+
df_selected_columns = df[columns_to_display].sort_values(by=['avg_score'], ascending=False).reset_index(drop=True)
|
| 10 |
# Display the selected columns as a table
|
| 11 |
st.dataframe(df_selected_columns, height=500, width=1000)
|
| 12 |
|
|
|
|
| 39 |
""", unsafe_allow_html=True)
|
| 40 |
|
| 41 |
if __name__ == "__main__":
|
| 42 |
+
main()
|