def drop_constant_column(dataframe):     """     Drops constant value columns of pandas dataframe.     """     return dataframe.loc[:, (dataframe != dataframe.iloc[0]).any()] 

Read more of this post