I am trying to make a dynamic list and then combine it with a fixed string to select columns from a dataframe:
import pandas as pd
df = pd.DataFrame([], columns=['c1','c2','c3','c4'])
column_list= ['c2','c3']
df2 = df[['c1',column_list]]
but I get the following error:
TypeError: unhashable type: 'list'
I tried a dict as well but that is similar error.