Python 如何将dataframe列更改为字符串
firs3是一个数据帧,已经对它进行了处理,现在我想返回STNAME列作为一个只包含STNAME的字符串列表,我该怎么做Python 如何将dataframe列更改为字符串,python,string,pandas,dataframe,Python,String,Pandas,Dataframe,firs3是一个数据帧,已经对它进行了处理,现在我想返回STNAME列作为一个只包含STNAME的字符串列表,我该怎么做 print(first3.loc['STNAME']) first3.STNAME.astype(str).value?first3['STNAME'].tolist()?或者对于loc,您需要为所有行添加::first3.loc[:,'STNAME'].tolist()
print(first3.loc['STNAME'])
first3.STNAME.astype(str).value
?first3['STNAME'].tolist()
?或者对于loc,您需要为所有行添加:
:first3.loc[:,'STNAME'].tolist()