2
我在大熊貓以下數據,我驚訝於該輸出爲:d + A 我期待A + d熊貓有序分類數據 - 初級
有人可以解釋請
df = pd.DataFrame(['A+','A','A-','B+','B','B-','C+','C','C-','D+','D'],
index = ['excellent','excellent','excellent','good','good','good','ok','ok','ok','poor','poor'])
df.rename (columns={0:'Grades'},inplace=True)
grades = df['Grades'].astype('category', categories = ['D','D+', 'C-', 'C','C+','B-','B','B+','A-','A','A+'],ordered=True)
print(max(grades),min(grades))