Python Forum
Reformat csv data with Python
Thread Rating:
  • 1 Vote(s) - 4 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Reformat csv data with Python
#1
Hello. I am a newbie to python taking a data analytics intro class. I need to reconfigure the data from a UN imported csv file to resemble my other csv files, e.g., cols 'Country or Area', 'Year', 'Value' with rows first grouped by country and then sorted by year decreasing and the values (HDI value) during those years.

The UN data csv I need to covert is configured cols 'Counrty or Area','1990','1991','1992'...'2014', 'HDI Rank'. The rows contains each country name and the values for each col year, and lastly the overall HDI Rank value.

I am using jupyter Projects notebook and don't know the code to manipulate the imported UN csv file data so that I can export a csv that has cols 'Country or Area', 'Year', 'Value', where the rows are sorted first by Country name (duplicated downward), then years descending, and then values for those years.

Help in the right direction is much appreciated!
Reply


Messages In This Thread
Reformat csv data with Python - by ksdst1 - Jul-23-2018, 06:25 PM
RE: Reformat csv data with Python - by Larz60+ - Jul-23-2018, 08:58 PM
RE: Reformat csv data with Python - by buran - Jul-23-2018, 09:04 PM
RE: Reformat csv data with Python - by ksdst1 - Jul-24-2018, 04:08 PM
RE: Reformat csv data with Python - by Larz60+ - Jul-24-2018, 07:14 PM
RE: Reformat csv data with Python - by ksdst1 - Jul-25-2018, 02:09 PM
RE: Reformat csv data with Python - by Larz60+ - Jul-25-2018, 04:02 PM
RE: Reformat csv data with Python - by ksdst1 - Jul-25-2018, 09:25 PM
RE: Reformat csv data with Python - by Larz60+ - Jul-25-2018, 09:39 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020