title: Is there a pandas functionality to get an None instead of an index error?
body: <p>I have a pandas (version 0.25) DataFrame with some indexes. When I'm looking for an index not present in the DataFrame, I (of course) get an KeyError.</p>
  
  <pre><code>import pandas as pd
  df = pd.DataFrame({'age': [50, 40]}, index = ['alice', 'bob'])
  # works, returns age 50:
  df.loc['alice']
  # does not work, gives KeyError
  </code></pre>
  
  <p>What I would like to have is something like <code>get</code> for dictionaries (<code>{'alice': 50}.get('charlie')</code>) for DataFrames. The best I could find was</p>
  
  <pre><code>df.loc['charlie'] if 'charlie' in df.index else None
  </code></pre>