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

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -7
app.py CHANGED
@@ -7,13 +7,12 @@ import warnings
7
  warnings.filterwarnings(action='ignore', category=UserWarning)
8
 
9
  # 设置中文字体和编码
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
  # 读取数据
@@ -51,8 +50,8 @@ iface = gr.Interface(
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
  ],
 
7
  warnings.filterwarnings(action='ignore', category=UserWarning)
8
 
9
  # 设置中文字体和编码
10
+ plt.rcParams['font.sans-serif'] = ['SimHei'] # 选择合适的中文字体,这里使用宋体
11
  plt.rcParams['axes.unicode_minus'] = False # 设置正常显示字符
12
 
13
+ def process_data(file_name, column1, column2, is_continuous, bins):
14
+ # column1 = "身高"
15
+ # column2 = "心血管疾病"
 
16
  is_continuous = True
17
  bins = 5
18
  # 读取数据
 
50
  fn=process_data,
51
  inputs=[
52
  gr.File(label="上传数据表格"),
53
+ gr.Textbox(label="指定第1个数据列名称"),
54
+ gr.Textbox(label="指定第2个数据列名称"),
55
  # gr.Checkbox(label="第1列数据是连续值类型", default=False),
56
  # gr.Number(label="如果第1列是连续值,要分为几组", optional=True),
57
  ],