答案 0 :(得分:4)
您可以使用:df.iloc[-1, 0]
。 When 2 indexers are passed to iloc
,第一个表示行的索引,第二个表示列的索引。因此Exception in Tkinter callback
Traceback (most recent call last):
File "C:\Python27\lib\lib-tk\Tkinter.py", line 1541, in __call__
return self.func(*args)
File "C:\Snake\snake.py", line 18, in open_file
call("C:")
File "C:\Python27\lib\subprocess.py", line 168, in call
return Popen(*popenargs, **kwargs).wait()
File "C:\Python27\lib\subprocess.py", line 390, in __init__
errread, errwrite)
File "C:\Python27\lib\subprocess.py", line 640, in _execute_child
startupinfo)
WindowsError: [Error 5] Access is denied
选择最后一行和第一列中的值。
或者,df[-1:].iloc[0].item()
would also work,但效率较低。