0

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?

1
  • data["Species"].tolist() Commented Jun 4, 2019 at 2:29

1 Answer 1

1

you have to cast the series to list output_data = list(data["Species"])

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.