- I am reading the csv as
ldf_raw_data = pd.read_csv(lstr_file_path, index_col=0)
- Dropping the
na
and usingT
to transpose it usingldf_raw_two = (ldf_raw_salary_slip.dropna()).T
- But I am getting
Unamed:1
as a multi-index. How can I remove it while performing transpose. - Reading CSV
- After transpose
- Expected output
- Sample CSV
Salary Slip,
,
Employee Name,Aditi Aggarwal
Salary Period,June 2019
Employer Name,Hewlett Packard Enterprise
CodePudding user response:
It looks like your csv file contains some information you don't need.
You could try just to skip those rows by using keyword skiprows
and header
.
ldf_raw_data = pd.read_csv(lstr_file_path, index_col=0, skiprows=2, header=None).T