Removing whitespace and carriage return from a text file with Python

  csv, file, pandas, python

I am having a dataframe that contains 4 columns while doing data cleaning process i got a problem caused by the carriage return from the text file as shown in the image below.

Problem :
enter image description here

I want to remove carriage return from the file to get the result below.Any suggestions are welcome

Result

Source: Python Questions

LEAVE A COMMENT