bezaime commited on
Commit
feba6f5
·
verified ·
1 Parent(s): 5be2eda

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -8
app.py CHANGED
@@ -4,14 +4,14 @@ df = pd.read_csv('./Automobile_data.csv')
4
  df = df.drop(columns = ['normalized-losses','symboling'], axis = 1)
5
 
6
  context_data = []
7
- for i in range(len(df)):
8
- context = ""
9
- for j in range(3):
10
- context += df.columns[j]
11
- context += ": "
12
- context += df.iloc[i][j]
13
- context += " "
14
- context_data.append(context)
15
 
16
 
17
  import os
 
4
  df = df.drop(columns = ['normalized-losses','symboling'], axis = 1)
5
 
6
  context_data = []
7
+ for i in range(len(df)): # Loop over rows
8
+ context = ""
9
+ for j in range(10): # Loop over the first 8 columns
10
+ context += df.columns[j] # Add column name
11
+ context += ": "
12
+ context += str(df.iloc[i][j]) # Convert value to string
13
+ context += " "
14
+ context_data.append(context)
15
 
16
 
17
  import os