1
我有一個名爲ratings_by_title,看起來像熊貓的GroupBy數據幀如下:索引熊貓Grouby數據幀給出錯誤
title
$1,000,000 Duck (1971) 37
'Night Mother (1986) 70
'Til There Was You (1997) 52
'burbs, The (1989) 303
...And Justice for All (1979) 199
1-900 (1994) 2
10 Things I Hate About You (1999) 700
101 Dalmatians (1961) 565
101 Dalmatians (1996) 364
12 Angry Men (1957) 616
我試圖篩選出具有等級> = 250的標題 所以,
我嘗試以下active_titles = ratings_by_title.index[ratings_by_title >= 250]
但是,這給在IPython中說
錯誤AttributeError: Cannot access attribute 'index' of 'DataFrameGroupBy' objects, try using the 'apply' method
有人能幫我理解發生了什麼嗎?