I have a large dataset with over 477 columns. The columns have long names such as Star Wars: Episode VII - The Force Awakens (2015).
I would like to obtain a subset of the data using the first word of the column name. For example; I would like to use df['Sta Wars'] to get the column with the title: Star Wars: Episode VII - The Force Awakens (2015), and all other columns with the words 'Star Wars','Harry Potter, and The Matrix.
I am getting an error while I use the code below:
df[‘Star Wars’, ‘Harry Potter’, ‘The Matrix’,‘Indiana Jones’, ‘Jurassic Park’, ‘Pirates of the Caribbean’, ‘Toy Story’, ‘Batman’]
Kindly help.