• python
  • javascript
  • reactjs
  • sql
  • c#
  • java
Facebook Twitter Instagram
Devs Fixed
  • python
  • javascript
  • reactjs
  • sql
  • c#
  • java
Devs Fixed
Home ยป Resolved: pandas Basic DataFrame concatenation not working in Python3

Resolved: pandas Basic DataFrame concatenation not working in Python3

0
By Isaac Tonny on 16/06/2022 Issue
Share
Facebook Twitter LinkedIn

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!

pandas python
Share. Facebook Twitter LinkedIn

Related Posts

Resolved: how to get and read an xml file in a zip file using xml.etree

02/04/2023

Resolved: The ‘Access-Control-Allow-Origin’ header contains multiple values ‘*, *’, but only one is allowed. cors error not resolving

02/04/2023

Resolved: SQLSTATE[42S02]: Base table or view not found: 1146 Table ‘crm.email’ doesn’t exist (Connection: mysql, SQL: select count(*) as aggregate from `email`

02/04/2023

Leave A Reply

© 2023 DEVSFIX.COM

Type above and press Enter to search. Press Esc to cancel.