i use the following codes to read data from csv using read_csv, but after i print the result and found the first column name is circled by double quote, but other column names are normal,
import pandas as pd
import numpy as np
import csv
path1 = "C:\\Users\\IBM_ADMIN\\Desktop\\ml- 1m\\SELECT_FROM_HRAP2P3_SAAS_ZTXDMPARAM_201611291745.csv"
frame1 = pd.read_csv(path1,encoding='utf8',dtype = {'COMPANY_ORGANIZATION': str})
frame1
The output is here
I think you can strip
column names by value "
:
df.columns = df.columns.str.strip('"')
Or if all values contains "
use parameter quotechar='"'
in read_csv
:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With