I have a dataframe with many columns and one row, and need to get the column headers for every time that a specific value appears. For example:
Date c1 col2 col3 col4 col5 rl6 d7
01/01/2016 00:00 37.04 36.57 35.77 37.56 36.79 35.90 38.15
... and given an array with the column names ['col2','col3','col4','col5']
,
I need to compare these names with header names, and wherever the column name matches the array, then get the corresponding value in a row. For example, col2
should give value 36.57