Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -15,7 +15,7 @@ class preProcess:
|
|
| 15 |
|
| 16 |
|
| 17 |
def check_columns(self, df):
|
| 18 |
-
if (len(df.columns) >
|
| 19 |
st.error('File has more than 3 coloumns.')
|
| 20 |
return False
|
| 21 |
if (len(df.columns) == 0):
|
|
@@ -63,7 +63,7 @@ class Model:
|
|
| 63 |
return summary
|
| 64 |
|
| 65 |
|
| 66 |
-
|
| 67 |
mode = st.selectbox('What kind of summary do you want?',
|
| 68 |
('Simple', 'Analytical'))
|
| 69 |
st.write('You selected: ' + mode + ' summary.')
|
|
@@ -74,9 +74,10 @@ if uploaded_file is not None and mode is not None and title is not None:
|
|
| 74 |
st.write('Preprocessing file...')
|
| 75 |
p = preProcess(uploaded_file, title)
|
| 76 |
contents = p.read_data()
|
| 77 |
-
st.write(contents)
|
| 78 |
check = p.check_columns(contents)
|
| 79 |
if check:
|
|
|
|
|
|
|
| 80 |
title_data = p.combine_title_data(contents)
|
| 81 |
st.write('Linearized input format of the data file:\n ')
|
| 82 |
st.markdown('**'+ title_data + '**')
|
|
|
|
| 15 |
|
| 16 |
|
| 17 |
def check_columns(self, df):
|
| 18 |
+
if (len(df.columns) > 4):
|
| 19 |
st.error('File has more than 3 coloumns.')
|
| 20 |
return False
|
| 21 |
if (len(df.columns) == 0):
|
|
|
|
| 63 |
return summary
|
| 64 |
|
| 65 |
|
| 66 |
+
st.write('This application generates a summary of a datafile (.csv). Right now, it only generates summaries of files with maximum of four columns. If the file contains more than four columns, the app will throw an error.')
|
| 67 |
mode = st.selectbox('What kind of summary do you want?',
|
| 68 |
('Simple', 'Analytical'))
|
| 69 |
st.write('You selected: ' + mode + ' summary.')
|
|
|
|
| 74 |
st.write('Preprocessing file...')
|
| 75 |
p = preProcess(uploaded_file, title)
|
| 76 |
contents = p.read_data()
|
|
|
|
| 77 |
check = p.check_columns(contents)
|
| 78 |
if check:
|
| 79 |
+
st.write('Your file contents:\n')
|
| 80 |
+
st.write(contents)
|
| 81 |
title_data = p.combine_title_data(contents)
|
| 82 |
st.write('Linearized input format of the data file:\n ')
|
| 83 |
st.markdown('**'+ title_data + '**')
|