I have the foll. text file:
line_1
line_2
line_3
Col_A Col_B Col_C
1.2 33 45
23 12 55
Here is how I read it:
df = pandas.read_table(file_name, skiprows=3, sep=' ', skipinitialspace=True)
Is there any way I can access just the header row?i.e. 'Col_A Col_B Col_C' as a string? I do not want to use df.columns.values since it returns an array. I want to get the header row with the spacing between different columns preserved.
df.columns.str.join(' ')or' '.join(df.columns)if you want a str