pandas - Ignoring newline character while reading csv file with mutiple delimiters in Python -
i have data contains '|' separator every row have newline separator not relevant. like:
- contrstart|"""contract end date"""contr1end:/bi0/oicontr1end|"""contract end re ason"""/bic/zuccancrs:/bic/oizuccancrs|"""disconnection date"""uc_didate:/bi0/o iuc_didate|"""dunning procedure"""cadunn_prc:/bi0/oicadunn_prc|"""dunning block reason"""cadunn_blo:/bi0/oicadunn_blo 4100006664||00000000|00000000|20130405|20130917|220000081194|20130405|20130903| 00000000|00000000||00000000|| 4100012973||00000000|00000000|20130409|20130430|220000145601|20130401|20130401|
if notice, first line ends @ 're' , next line begins 'ason'. same other rows. rows separated '/n' cannot ignore these newline characters. there way ignore these specific newline separator while reading in python?
i think can use dropna method,
#first read in put df=pd.read_csv('file.csv',sep='|') #then ignore new line df=df.dropna()
if want different add comment.:)
Comments
Post a Comment