I try to import the file data.csv into a pd.DataFrame where the column names are placed in a commented line. Using data = pd.read_csv ('data.csv', sep = ',', skiprows = 1, thousands = None, decimal = '.') doesn't remove the comment sign (//) from the header. When I say comment = '//', I don't get the column names, which can vary from file to file.
How do I remove the comment sign from the first column name?
My data.csv:
//general comment, shouldn't pe parsed
//<d_d>,<a_d>,<a_a>
7199.71,173.965,7279.85
5671.23,1576.78,5272.2
6905.44,-1008.56,6864.76
7701.41,-90.0966,8611.31
7253.81,-377.103,2863.48
4745.01,1951.36,4020.75
The resulting pd.DataFrame:
//<d_d> <a_d> <a_a>
0 7199.71 173.9650 7279.85
1 5671.23 1576.7800 5272.20
2 6905.44 -1008.5600 6864.76
3 7701.41 -90.0966 8611.31
4 7253.81 -377.1030 2863.48
5 4745.01 1951.3600 4020.75