Question:
I’m doing a simple DataFrame concatenation tutorial for Python3. You can find this tutorial here:
https://www.geeksforgeeks.org/dealing-with-rows-and-columns-in-pandas-dataframe/
Upon attempting to print df_new I get this output
This is not the expected output. I was wondering if I was doing something wrong as I re-downloaded the csv in case the csv was corrupted somehow however that does not seem to be the case. I am new to python so I’m trying to figure out why DataFrame.head() is not working in terms of not reducing the output dataframe to 5 elements, and why the actual values are being set to null.
If anyone has any ideas let me know.
Answer:
This is an error in the tutorial. Just read the CSV without “index_col=’Name'”, and run the same code and it will work
If you have better answer, please add a comment about this, thank you!