I just started learning Python and using pandas for data analysis and I would like to know what the right way of opening a .dat file is and if it would be better to convert .dat into .csv and use this file extension instead?
I tried to open the file by simply typing
df_topex = open('datasets/TOPEX.dat', 'r')
print(df_topex)
and I got the following:
<_io.TextIOWrapper name='datasets/TOPEX.dat' mode='r' encoding='UTF-8'>
When trying:
df_topex = pd.read_csv('datasets/TOPEX.dat')
df_topex
the first row of data is considered as a header. In this particular data file, there are no headers so I would like this to be avoided. Is there a simple way of saying that this particular file has no headers or should I create them? If so, how?