title: How do I count the number of times a date shows up in a list?
body: <p>So I am having an issue. I am trying to create a script that will look at a layer in ArcMap (we use 10.2.2) create a csv file that for the final output will have the technicians name and the number of tracts that they have looked at on a particular day. To do this, I think that I need to create a dictionary that is specific to each technician and has the date as a key and the number of times it comes up as the value.</p>
  
  <p>This is where I am getting stuck. How do I create a dictionary that counts the number of times a date comes up? </p>
  
  <p>I included my code so far and I am at a huge loss of where to go or if I am even on the right tract. Also I am unsure how to make the csv file with all three columns I need (Name, Date, Count).</p>
  
  <pre><code>import arcpy, datetime
  from arcpy import mapping
  from datetime import datetime
  
  # pass layer to script
  mxd = mapping.MapDocument("C:\\Users\\eschlueter\\Desktop\\test\\test.mxd")
  layers = mapping.ListLayers(mxd)
  
  inLayer = layers[0]
  csvfilename = "C:\\Users\\eschlueter\\Desktop\\test\\test1.csv"
  
  # Create the search cursor
  cursor = arcpy.SearchCursor(inLayer)
  
  ##define a dictionary of every technician
  elizabethtech = {}
  unknowntech = {}
  
  ##create a counter for each technician's contracts
  Elizabethcontract = 0
  Unknowncontract = 0
  
  ##Define Variables and Iterate through the rows in cursor
  desc = arcpy.Describe(inLayer)
  fields =  desc.fields
  for field in fields:
      for srow in cursor:
          tech = srow.getValue("Technician")
          ModDate = srow.getValue("ModifiedDate")
          if tech == "Elizabeth Schlueter":
              Elizabethcontract = Elizabethcontract + 1
              ESList = []
              ES = {}
              FormDate = ModDate.strftime("%m-%d-%Y")
              print FormDate
              ESList.append(FormDate)
              c = ESList.count(FormDate)
              ES[FormDate] = c
              print ES
  </code></pre>
  
  <p>I could really use some help on this one! Thank you guys for helping me in advance!</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>I have been able to create the dictionary using the Counter and the .update method and created a master list of all the technicians as the key and the value being the (date, count). How do I now take this dictionary and print a csv file? I want the file to have the technician name and the date and the count of the dates. Is this possible?</p>