在GUI中显示统计结果

发布于 2025-01-10 01:22:35 字数 98 浏览 4 评论 0原文

我有一个数据集,并使用生命线库对其执行 kaplan meier 分析,然后执行对数排名和 cox 分析,但我收到的输出是“统计结果”类型,我希望在 GUI 上显示它,但无法弄清楚。

I have a dataset and perform kaplan meier analysis on it using lifelines library, I then perform log rank and cox analysis, but the output i receieve are type 'statistical result' I would live to display this on a GUI but cannot figure it out.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

扭转时空 2025-01-17 01:22:35

您可以将数据保存为 csv 文件。

由此,像 tkinter 这样的(或任何)包可以读取 CSV。

这是一个 stackoverflow 链接:

如何在网格中显示 csv 文件?

这是代码示例:

import tkinter
import csv

root = tkinter.Tk()

# open file
with open("test.csv", newline = "") as file:
   reader = csv.reader(file)

   # r and c tell us where to grid the labels
   r = 0
   for col in reader:
      c = 0
      for row in col:
         # i've added some styling
         label = tkinter.Label(root, width = 10, height = 2, \
                               text = row, relief = tkinter.RIDGE)
         label.grid(row = r, column = c)
         c += 1
      r += 1

root.mainloop()

显然,您需要将您的变体应用于此。

You can save the data as a csv file.

From this, a (or any) package like tkinter can read the CSV.

Here is a stackoverflow link to such:

How to show csv file in a grid?

And here is an example of the code:

import tkinter
import csv

root = tkinter.Tk()

# open file
with open("test.csv", newline = "") as file:
   reader = csv.reader(file)

   # r and c tell us where to grid the labels
   r = 0
   for col in reader:
      c = 0
      for row in col:
         # i've added some styling
         label = tkinter.Label(root, width = 10, height = 2, \
                               text = row, relief = tkinter.RIDGE)
         label.grid(row = r, column = c)
         c += 1
      r += 1

root.mainloop()

Obviously, you would need to apply your variant to this.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文