Python pandas
.reset_index(drop=True) 对行号进行重新排序
.apply函数 添加自定义函数
若要使用series,需from pandas import Series
dataframe里面是series,series里面是array
rt_scores与film_names来自同一dataframe,都是series类型,series可用字符串作为索引值
.set_index 指定FILM为索引值
如上,以FILM为索引值后的操作,类似数值索引
Python pandas
.reset_index(drop=True) 对行号进行重新排序
.apply函数 添加自定义函数
若要使用series,需from pandas import Series
dataframe里面是series,series里面是array
rt_scores与film_names来自同一dataframe,都是series类型,series可用字符串作为索引值
.set_index 指定FILM为索引值
如上,以FILM为索引值后的操作,类似数值索引
相关文章: