所以我在表格中制作了一个表格,输出如下所示:
但我希望它看起来像这样:
那么我该怎么做呢?
这是我的代码:
from tabulate import tabulate
nums = {"Numbers": [0, 3.5, " ", -2, " "], "Seconds": [" ", " ", 24, " ", 3]}
print(
tabulate(nums, tablefmt="grid", headers=nums.keys(), colalign=("center", "center"))
)
我将不胜感激,谢谢。