xycold commited on
Commit
1648b05
·
verified ·
1 Parent(s): 4aeef47

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -5
app.py CHANGED
@@ -10,7 +10,12 @@ warnings.filterwarnings(action='ignore', category=UserWarning)
10
  plt.rcParams['font.sans-serif'] = ['Arial Unicode MS'] # 选择合适的中文字体,这里使用宋体
11
  plt.rcParams['axes.unicode_minus'] = False # 设置正常显示字符
12
 
13
- def process_data(file_name, column1, column2, is_continuous, bins):
 
 
 
 
 
14
  # 读取数据
15
  df = pd.read_csv(file_name)
16
  data_x = df[column1]
@@ -46,10 +51,10 @@ iface = gr.Interface(
46
  fn=process_data,
47
  inputs=[
48
  gr.File(label="上传数据表格"),
49
- gr.Textbox(label="指定第1个数据列名称"),
50
- gr.Textbox(label="指定第2个数据列名称"),
51
- gr.Checkbox(label="第1列数据是连续值类型", default=False),
52
- gr.Number(label="如果第1列是连续值,要分为几组", optional=True),
53
  ],
54
  outputs=[
55
  gr.Dataframe(type='pandas', label="数据表的前5行"),
 
10
  plt.rcParams['font.sans-serif'] = ['Arial Unicode MS'] # 选择合适的中文字体,这里使用宋体
11
  plt.rcParams['axes.unicode_minus'] = False # 设置正常显示字符
12
 
13
+ def process_data(file_name):
14
+ # , column1, column2, is_continuous, bins
15
+ column1 = "身高"
16
+ column2 = "心血管疾病"
17
+ is_continuous = True
18
+ bins = 5
19
  # 读取数据
20
  df = pd.read_csv(file_name)
21
  data_x = df[column1]
 
51
  fn=process_data,
52
  inputs=[
53
  gr.File(label="上传数据表格"),
54
+ # gr.Textbox(label="指定第1个数据列名称"),
55
+ # gr.Textbox(label="指定第2个数据列名称"),
56
+ # gr.Checkbox(label="第1列数据是连续值类型", default=False),
57
+ # gr.Number(label="如果第1列是连续值,要分为几组", optional=True),
58
  ],
59
  outputs=[
60
  gr.Dataframe(type='pandas', label="数据表的前5行"),