Append Dataframe columns as a list
df.filter(regex='valid') returns DataFrame whose column contains pattern valid. df.values return a Numpy representation of the DataFrame. numpy.tolist() convert the Numpy array to Python list.
df1=[df['1valid'],df['2valid'],...df['nvalid']] is a list of Series.
I have a dataframe with 500+ columns and I want to just store the values from certain columns that contain the string "valid" in their names and store them in a new empty list.
I have used df1=df.filter(regex='valid').values.tolist()
My earlier method was - df1=[df['1valid'],df['2valid'],...df['nvalid']] 
I'm unable to differentiate between the two. Any help would be appreciated.