I have pandas dataframe called data
of size (150, 5). Now I want to get the data in the last column whose header is "Species":
output_data = data["Species"]
The resulting output_data
is of type Series
including an index column. How to remove the index data or directly extract the data of the Species
column?
您必须将系列转换为列表output_data = list(data["Species"])
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.