0

I would like to create a data frame from another data frame - but I want to do it by specifying the coordinates. In this case I want the new DataFrame to contain only the first column.

The following is correct in that it works:

US_effective_rate = US_forward_rates.iloc[:,1].copy()
US_effective_rate = US_effective_rate.to_frame()

I was wondering if there's a better implementation, possibly using .filter()?

there are similar questions but they reference column names, not coordinates.

thank you very much.

PS: I actually just want the dimensions and index from the first frame, going to overwrite the actual data. Any chance I could do THAT in one hit?

1 Answer 1

1

Yes you can just add []

US_forward_rates.iloc[:,[1]]
Sign up to request clarification or add additional context in comments.

1 Comment

Boom! Thank you so much!

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.