You want to read a text file in pandas.
To read a text file in pandas we use the read_csv method along with the delimiter that is used in the file. Your file could have other delimiter like tab ( ‘\t’ ) , commas ( ‘,’ ), space ( ‘ ‘ ) etc. Here we have semicolon so we used that.
import pandas as pd df = pd.read_csv('salary.txt', delimiter=';') df.head()