以下内容来自链接:https://blog.csdn.net/qq_42648305/article/details/89634186 遍历pd.Series的index和value的方法如下,python built-in list的enumerate方法不管用 for i, v in s.items(): print('index: ', i, 'value: ', v)#index: a value: 1#index: b value: 2#index: c value: 3#index:…
python. pandas(series,dataframe,index,reindex,csv file read and write) method test import pandas as pdimport numpy as np def testpandas(): p = pd.Series([1,2,3,4,5],index =('a','b','c','d','e')) print(p) cities = {'bejing':5500,'shanghai':5999,'shezh…