title: Retrieve data based on date from excel with pandas
body: <p>hello all I'm stuck in the following steps using Python and Pandas. I'm trying to retrieve the country with the most goals in &quot;FIFA&quot; matches since 2010.</p>
  <p>[excel sheet picture][1]</p>
  <p>Below is a piece of code and not sure if it's alright since I'm still learning.</p>
  <pre><code>#Which country has scored the most goals in FIFA events (qualifiers, 
  #cups, etc.) since 2010? 
  
  
  # convert to datetime format
  df['date'] = pd.to_datetime(df['date'], format='%Y-%m-%d')
  
  # to get the most goals by sum
  df['total_score'] = df['home_score'] + df['away_score']  
  
  
  #Not sure how to check all data as long as theres the word FIFA in it?
  sub_df = df[ (df['tournament'] == &quot;FIFA&quot;) &amp; (df['neutral'] != &quot;True&quot;) ] 
  
  #Not sure how to check all data as long as theres the word FIFA in it?
  sub_df = df[(df['tournament'] == &quot;FIFA&quot;) &amp; (df['date'].dt.year &gt;= 2010)]
  
  # to get maximum total_score
  sub_df2 = sub_df[sub_df['total_score'] == sub_df['total_score'].max()]  
  
  print(sub_df2)
  
  **Empty DataFrame
  Columns: [date, home_team, away_team, home_score, away_score, 
  tournament, city, country, neutral, total_score]
  Index: []**
  </code></pre>
  <p><strong>EDIT: Updated code but not sure how to return the Country with most goals</strong></p>
  <pre><code>df['date'] = pd.to_datetime(df['date'], format='%Y/%M/%D')
  
  # to get the most goals by sum
  df['total_score'] = df['home_score'] + df['away_score']  
  
  #to get data only from year 2010 and up and events that have the word 
  #FIFA in it
  sub_df = df[(df['date'].dt.year &gt;= 2010) &amp; 
  (df['tournament'].str.contains('FIFA'))]
  
  #Which country has scored the most goals in FIFA events (qualifiers, 
  #cups,  etc.) since 2010? 
  sub_df2 = sub_df[sub_df['total_score'] == sub_df['total_score'].max()]
  
  #print the return value of the country with most goals
  print(sub_df2)
  print(sub_df2['country'], sub_df2['total_score'].max())
  print(&quot;The country that has scored the most goals in FIFA events is: &quot;)`
  </code></pre>
  <p>This is what is being returned:
  [enter image description here][1]</p>
  <p><strong>I want to return the country with the most goals scored in all FIFA events</strong>
  [1]: <a href="https://i.stack.imgur.com/DxONa.png" rel="nofollow noreferrer">https://i.stack.imgur.com/DxONa.png</a></p>