title: Place items from a list into a date class
body: <p>I have a bunch of of dates in the format [yyyy, m, d] being pulled from a CSV column. I basically want to iterate through and turn all of those lists into &quot;dates&quot;. Ive imported date, and I know that the date class takes 3 arguments (year, month, day). How Would i loop through and put the values from my list in as the arguments for the date class?</p>
  <p>Below is my code. The CSV file has the first column filled with dates in the format mm/dd/yyyy, which I have already put into the yyyy/mm/dd interger format.</p>
  <pre><code>from datetime import date
  
  from csv import reader
  # open file in read mode
  with open('food.csv',  encoding='utf-8-sig') as read_obj:
      # pass the file object to reader() to get the reader object
      csv_reader = reader(read_obj)
      # Iterate over each row in the csv using reader object
    
      for row in csv_reader:
          # row variable is a list that represents a row in csv
          
          date_str = row[0].replace('/',',')
          
          date_list = date_str.split(&quot;,&quot;)
          
          my_order = [2,0,1]
          date_list = [date_list[i] for i in my_order]
         
          for i in range(0, len(date_list)):
              date_list[i] = int(date_list[i])
  
              
                                  
          exp_date = date(date_list[i])
          
          
          
         
          print(exp_list)
  </code></pre>
  <p>got error: TypeError: function missing required argument 'month' (pos 2)</p>