刚开始学Python,学到Categorical这里出了点问题,查了一圈貌似是因为Python版本不一样才会报错,但是并没有找到合适的解决方法,代码如下,请大神帮忙看看
Cut=pd.Series(["Fair","Good","Very Good","Premium","Ideal"])
Cut_Facor2=Cut.astype("category",categories=["Good","Fair","Very Good","Ideal","Premium"],ordered=True)