title: Drop all drows in python pandas dataframe except
body: <p>Beginner Pandas Question:</p>
  
  <h2>How do I drop all rows except where Ticker = NIVD?</h2>
  
  <p>That is, return a dataframe like:</p>
  
  <pre><code>   Sector Ticker  Price
   0 Future   NVID    350
   1 Future   NVID    NaN   
  </code></pre>
  
  <p>Dataframe Code:</p>
  
  <pre><code>import numpy as np
  import pandas as pd
  raw_data = {'Sector': [ 'Gas', 'Future', 'Future', 'Gas', 'Beer', 'Future'],
      'Ticker': ['EX', 'NVID', 'ATVI', 'EX', 'BUSCH', 'NVID'],
      'Price': [100, 350, 250, 500, 50, np.NaN]} 
  df = pd.DataFrame(raw_data, columns = ['Sector', 'Ticker', 'Price'])
  print(df)
  </code></pre>
  
  <p>So Far I'm playing around with have:</p>
  
  <p><code>new_df =df[ ~(df[TICKER] == 'NVIDA'):, ]</code> OR</p>
  
  <p><code>dummy_df=df.loc[:, ~(df == 'NVIDA')]</code></p>