PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Monday, August 29, 2022

[FIXED] how i convert csv using pandas with a lot of delimiter

 August 29, 2022     csv, dataset, delimiter, pandas, python     No comments   

Issue

My dataset (national income):

dataset national income

How can I find what delimiter is for my dataset, because I try to read my dataset csv file using pandas libraries but I already try a comma (,), a semicolon (;), a tab (\t), a space ( ) and a pipe (|) but it still didn't work. I also try df=pd.read_csv("file name", sep='delimiter') but it still didn't work. Is there someone help me, what should I do?


Solution

Either remove the first four rows of the dataset as they aren't relevant and save the CSV then everything will work fine in pandas after using , as delimiter OR use skiprows as while reading the CSV:

df = pd.read_csv("net_national_income.csv", skiprows = 4)


Answered By - Prashant Maurya
Answer Checked By - David Goodson (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing