当前位置:网站首页>Dataframe extracts data from a column and converts it into a list

Dataframe extracts data from a column and converts it into a list

2022-06-26 01:44:00 Passion6378

df as follows , Purpose : Extract the data of English column , And turn it into a list .

1,df[" English "] by object type , First to int type .

array = pd.to_numeric(df[" English "])  # object Type to int type 
print(array)

2, then array To list

list = array.tolist()  # array To list
print(list)

 

原网站

版权声明
本文为[Passion6378]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202180553453932.html