I have Hive db table csv extract which has no header. I loaded csv as dataframe andit has no column name. Since length of column will change as per datatable, how can I assign col name according to column length?
i know the way to assign column for fixed column length.
>>> df1 = pd.read_csv('/home/j/HiveOP_06June_1.csv', header = None)
>>> df1.columns = ['Col1','Col2', 'Col3']
>>> df1
Col1 Col2 Col3
0 XPRN A 2019-12-16 00:00:00
If I am exporting data table with 25 columns then how can i name all col on the fly?
df.add_prefix("Col")?