下面我列出了我的对象countiespop返回的内容以及对象的类型.我找不到一种方法来创建一系列独有的3'STNAME'.
countiespop
Returns
STNAME
California 15924150
Texas 8269632
Illinois 6815061
Name: CENSUS2010POP, dtype: int64
Run Code Online (Sandbox Code Playgroud)
type(countiespop)
返回
pandas.core.series.Series
这就是你追求的吗?
#create a series using the index of the current Series
pd.Series(countiespop.index)
Out[274]:
0 California
1 Texas
2 Illinois
Name: a, dtype: object
Run Code Online (Sandbox Code Playgroud)