title: How to use the filtered data in Pandas?
body: <p>I am new to Pandas. Below is part of a code. I am trying to use the  df_filtered which is the filtered data having codenum column value =AB123. However from Line 14 if I use df_filtered instead of excel_data_df , it's not giving results. The desired columns are getting picked correctly. But the value filtering is not happening - In codenum col value should be = AB123.  But the  value filtering is not happening and I am getting the entire excel converted to json with chosen columns. Please help understand how to consider/use df_filtered data from Line 14.</p>
  <pre><code>PathLink = os.path.join(path, 'test' + '.json') #Path Name Formation 
          excel_data_df = pandas.read_excel('input.xlsx',
                                            sheet_name='input_sheet1',
                                            usecols=[4,5,6,18,19], #index starts from 0
                                            names=['codenum', 'name',
                                                    'class',
                                                    'school',
                                                    'city'],
                                             dtype={'codenum': str,
                                                    'name': str,
                                                    'school': str,
                                                    'city': str})  # Excel Read and Column Filtering
          df_filtered = excel_data_df.loc[lambda x: x['codenum'] == 'AB123']    # Row Filtering   -- need to use this further     
          excel_data_df.columns = ['Code', 'Student Name', 'Class', 'School Name','City Name'] #renaming columns  -- Line Num 14
          cols_to_keep = ['Student Name', 'Class', 'School Name','City Name'] # columns to keep
          excel_data_df = excel_data_df[cols_to_keep]  # columns to keep
          excel_data_df                                # columns to keep
          json_str = excel_data_df.to_json(PathLink,orient='records',indent=2) #json converted file
  </code></pre>