i'm making a code where in one part I need to access to data inside a DataFrame. The main problem is that the columns in dataframe may change depending on file accessed. So i've thinked that I could define aux var for the keys to access it. My main problem now is that the code seems to work but the solusion looks pretty ugly.
if isAirData:
LOGlat = 'latitude'
LOGlon = 'longitude'
LOGalt = 'height_above_takeoff(feet)'
LOGtime = 'datetime(utc)'
LOGhead = 'compass_heading(degrees)'
LOGpitch= 'gimbal_pitch(degrees)'#pitch(degrees)'
LOGroll = 'roll(degrees)'
LOGvid = 'isVideo'
else:
LOGlat = 'OSD.latitude'
LOGlon = 'OSD.longitude'
LOGalt = 'OSD.height[ft]'
LOGtime = 'CUSTOM.updateTime[local]'
LOGhead = 'OSD.yaw'
LOGpitch= 'OSD.pitch'
LOGroll = 'OSD.roll'
LOGvid = 'CAMERA.isVideo'
these are my keys of interest. In the different files column number and names changes. So I was wondering which is the best way to work with this?