我有这个代码:
from tabulate import tabulate
import pandas
df = pandas.DataFrame({'Col2' : ['Hello', 'How' , 'Are', 'You'],
'Col3' : ['Hi', 'I', 'am', 'fine']})
nice_table = tabulate(df, headers='keys', tablefmt='psql')
print(nice_table)
它打印这个:
+----+--------+--------+
| | Col2 | Col3 |
|----+--------+--------|
| 0 | Hello | Hi |
| 1 | How | I |
| 2 | Are | am |
| 3 | You | fine |
+----+--------+--------+
有没有办法访问和打印给定单元格的内容nice_table
?