1

I created a successful df, however, there's something wrong with the column names. they are not on the same row.

Anyone can give some advices? Appreciate it.

enter image description here

1 Answer 1

2

The first "Column" isn't a column. It's an index.

pandas wants to differentiate between the name of the index "Industry" and the name of the columns "YTD_change". So it put's them on different lines. It's purely formatting.

Try:

df.reset_index()
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.