如何从透视表中获取特定值-python

如何从透视表中获取特定值-python,python,pandas,dataframe,pivot-table,Python,Pandas,Dataframe,Pivot Table,如何从数据透视表中获取特定值? 我需要将“imdb_score”作为int存储在变量中。 我该怎么做 以下是该表的内容: country_id director_id duration gross id_x id_y imdb_score title_year director_name Christopher Nolan 1

如何从数据透视表中获取特定值? 我需要将“imdb_score”作为int存储在变量中。 我该怎么做

以下是该表的内容:

                  country_id     director_id      duration      gross     id_x  id_y    imdb_score    title_year
director_name                               
Christopher Nolan     1              16          143.428571  2.494235e+08   1   16         8.6       2007.857143

将索引设置为dataframe中要用于筛选的唯一列

var=df.loc['Christopher Nolan','imdb_score']