1# Basic syntax:
2new_dataframe = dataframe.filter(['col_name_1', 'col_name_2'])
3# Where the new_dataframe will only have the column names specified
4
5# Note, use df.filter(['names', ... ], axis=0] to select rows
1import pandas as pd
2
3input_file = "C:\\....\\consumer_complaints.csv"
4dataset = pd.read_csv(input_file)
5df = pd.DataFrame(dataset)
6cols = [1,2,3,4]
7df = df[df.columns[cols]]
8