Q:

Python how to call either of the two columns of a dataframe

I have big data frame of many columns. I want to either of the two columns at any time. 
df.columns = ['c1','c1T1','c2','c2T1',...........,'c10','c10T1',
'c30','c30T2','c40','c40T2',...........,'c60','c60T2'] 

I know that the column names are 'c1',...,'c4'. There is another column associated with each of these. 
My logic of calling the second column is 'c1'+['T1' or 'T2']. I know that there is only one column 'c1T1', not 'c1T2'. so, how to search such combination in df[].
My present code: 
   df[['c1','c1'+'T1'|.'T2']]

My present output: 
SyntaxError: invalid syntax 

How to call the second column associated with the first?

A:

You can automate the creation of columns names that you want using lists & then use that list to look to the columns you need. Code below.
You can change the lists prefixes & postfixes to get the columns you need.
prefixes = ['c1']
postfixes = ['', 'T1','T2']
colsToCheck = [prefix+postfix for prefix in prefixes for postfix in postfixes]
cols = [col for col in colsToCheck if col in df.columns]  
df[cols]

