Spaces:
Sleeping
Sleeping
Update app.py
Browse filestabular reaarangement make header first row
app.py
CHANGED
@@ -18,6 +18,9 @@ question = st.text_input("Enter your question:")
|
|
18 |
if uploaded_file is not None and question:
|
19 |
# Read table from CSV
|
20 |
table = pd.read_csv(uploaded_file)
|
|
|
|
|
|
|
21 |
|
22 |
# Display the table
|
23 |
st.write("Uploaded Table:")
|
|
|
18 |
if uploaded_file is not None and question:
|
19 |
# Read table from CSV
|
20 |
table = pd.read_csv(uploaded_file)
|
21 |
+
new_header = table.iloc[0] #grab the first row for the header
|
22 |
+
table = table[1:] #take the data less the header row
|
23 |
+
table.columns = new_header
|
24 |
|
25 |
# Display the table
|
26 |
st.write("Uploaded Table:")
|