saadob12 commited on
Commit
86f9681
·
1 Parent(s): dcfd954

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -1
app.py CHANGED
@@ -28,9 +28,14 @@ class preProcess:
28
  headers = [[] for i in range(0, len(df.columns))]
29
  for i in range(len(df.columns)):
30
  headers[i] = list(df[df.columns[i]])
 
31
  zipped = list(zip(*headers))
32
  res = [' '.join(map(str,tups)) for tups in zipped]
33
- input_format = ' labels ' + ' - '.join(list(df.columns)) + ' values ' + ' , '.join(res)
 
 
 
 
34
 
35
  return input_format
36
 
 
28
  headers = [[] for i in range(0, len(df.columns))]
29
  for i in range(len(df.columns)):
30
  headers[i] = list(df[df.columns[i]])
31
+
32
  zipped = list(zip(*headers))
33
  res = [' '.join(map(str,tups)) for tups in zipped]
34
+ if len(df.columns) < 2:
35
+ input_format = ' x-y values ' + ' - '.join(list(df.columns)) + ' values ' + ' , '.join(res)
36
+
37
+ else:
38
+ input_format = ' labels ' + ' - '.join(list(df.columns)) + ' values ' + ' , '.join(res)
39
 
40
  return input_format
41