code: def batting_stats_range(start_dt=None, end_dt=None):
      
      # make sure date inputs are valid
      start_dt, end_dt = sanitize_input(start_dt, end_dt)
      if datetime.datetime.strptime(start_dt, "%Y-%m-%d").year < 2008:
          raise ValueError("Year must be 2008 or later")
      if datetime.datetime.strptime(end_dt, "%Y-%m-%d").year < 2008:
          raise ValueError("Year must be 2008 or later")
      # retrieve html from baseball reference
      soup = get_soup(start_dt, end_dt)
      table = get_table(soup)
      table = table.dropna(how='all')  # drop if all columns are NA
      # scraped data is initially in string format.
      # convert the necessary columns to numeric.
      for column in ['Age', '#days', 'G', 'PA', 'AB', 'R', 'H', '2B', '3B',
                      'HR', 'RBI', 'BB', 'IBB', 'SO', 'HBP', 'SH', 'SF', 'GDP',
                      'SB', 'CS', 'BA', 'OBP', 'SLG', 'OPS']:
          #table[column] = table[column].astype('float')
          table[column] = pd.to_numeric(table[column])
          #table['column'] = table['column'].convert_objects(convert_numeric=True)
      table = table.drop('', 1)
      return table
docs: Get all batting stats for a set time range. This can be the past week, the
      month of August, anything. Just supply the start and end date in YYYY-MM-DD
      format.