title: How to Query a String in Pandas
body: <p>I am currently practicing pandas</p>
  <p>I am using some pokemon data as a practice <a href="https://gist.github.com/armgilles/194bcff35001e7eb53a2a8b441e8b2c6" rel="nofollow noreferrer">https://gist.github.com/armgilles/194bcff35001e7eb53a2a8b441e8b2c6</a></p>
  <p>i want to make a program that allows the user to input their queries and I will return the result that they need.</p>
  <p>since i do not know how many parameters the user will input, i just made some code that will break that up and then put it in the format that pandas can understand, but when i am trying to execute my code, it just returns None.</p>
  <p>whats wrong with my code?</p>
  <p>thank you</p>
  <pre><code>import pandas as pd
  
  df = pd.read_csv(r'PATH HERE')
  column_heads = df.columns
  print(f'''
  This is a basic searcher
  
  Input your search query as follows:
  &lt;Head1&gt;:&lt;Value1&gt;, &lt;Head2&gt;:&lt;Value2&gt; etc..
  
  Example: 
  Type 1:Bug,Type2:Steel,Legendary:False
  
  Heads:
  {column_heads}
  
  ''')
  
  
  usr_inp = input('Enter Query: ')
  queries = usr_inp.split(',')
  parameters = {}
  for query in queries:
      head, value = query.split(':')
      parameters[head] = value
  
  print('Your search parameters:', parameters)
  
  df_query = 'df.loc['
  for key,value in parameters.items():
      df_query += f'''(df['{key}'] == '{value}')&amp;'''
  
  
  df_query = df_query[:-1] + ']'
  
  exec('''print(exec(df_query))''')
  
  </code></pre>