title: How to add title row to using writer and unicodecsv
body: <p>I have the following JSON file - test.json (names, keys and addresses changed for security reasons)</p>
  
  <pre><code>   [  
     {  
        "accountMode":"Live",
        "acquirer":"TEST",
        "acquirerConstraints":{  
           "cardTypes":[  
              "MASTERCARD",
              "MAESTRO",
              "VISA"
           ],
           "cvcRegexp":"^[0-9]{3}$",
           "cvcRequired":true,
           "maxAmount":500000,
           "minAmount":50
        },
        "acquirerDetails":{  
           "TEST":"Studio",
           "ERROR_LIST":[  
  
           ],
           "MERCHANT_CODE":"218331",
           "VALID":true,
           "_mId":"T712484",
           "_status":"INPROCESS",
           "email":"test7@gmail.com",
           "name":"Studio",
           "valid":true
        },
        "acquirerValidations":null,
        "allowedCurrencies":[  
           "EUR",
           "USD",
           "GBP"
        ],
        "apiKeyPairs":[  
           {  
              "accountMode":"Live",
              "label":"Virtual Terminal",
              "publishableKey":"niunibiubniunijknkjknj",
              "source":"VIRTUAL_TERMINAL"
           },
           {  
              "accountMode":"Live",
              "label":"Default",
              "publishableKey":"iiuhiuhiu",
              "source":"ECOMMERCE"
           }
        ],
        "appLogoUrl":null,
        "applicationId":"541d75e0-7db8b343a31f",
        "authorizationCode":"",
        "closedDate":null,
        "closureReason":null,
        "declineAvsAddressFailure":false,
        "declineAvsZipFailure":false,
        "declineCvcFailure":false,
        "defaultCurrency":"EUR",
        "descriptor":null,
        "email":"test1@gmail.com",
        "id":"ddddeff",
        "invitationCode":null,
        "locale":"en_IE",
        "merchantApplication":{  
           "accountNumber":null,
           "acquirer":"TEST",
           "annualAmount":null,
           "annualVolume":null,
           "applicationType":"APPROVAL",
           "bankName":"UNKNOWN",
           "brand":null,
           "businessAddress":"54 My St, 1",
           "businessAddress2":null,
           "businessCity":"Abbey",
           "businessCountry":"IRL",
           "businessPhone":null,
           "businessState":"DUBLIN",
           "businessZip":null,
           "data":null,
           "email":"test@gmail.com",
           "escalationPhone":null,
           "fax":null,
           "legalName":"UAB \"Studio\"",
           "maxTransactionAmount":null,
           "mccCode":"5712",
           "merchantPromotionCode":null,
           "mobile":null,
           "monthlyAmount":null,
           "monthlyVolume":null,
           "ownerFirstName":"tlana",
           "ownerLastName":"nava",
           "phone":"37647",
           "GuideAccepted":null,
           "privacyAccepted":true,
           "privacyVersion":"1a",
           "referenceId":"9104d65i08d071",
           "routingNumber":null,
           "singleTransactionAmount":null,
           "statementName":"UAB \"Studio\"",
           "taxId":null,
           "termsAccepted":true,
           "termsVersion":"1a",
           "url":"http://www.design.lt"
        },
        "merchantId":"12484",
        "merchantPromotionCode":null,
        "mposEnabled":true,
        "name":"Studio",
        "netonfiguration":null,
        "onboardedDate":1505513232485,
        "onboardingMethod":null,
        "onboardingStatus":"INPROCESS",
        "partner":null,
        "saqCompliant":false,
        "saqExpires":null,
        "settings":[  
           {  
              "key":"MERCHANT_DETAILS",
              "value":"{\"zip\":\"Wicklow\",\"phone\":\"342647\",\"email\":\"suppoor@outlook.com\",\"address\":\"Bck 6\",\"state\":\"Ireland\",\"addressLine2\":\"Unit 8, Bl Par\",\"city\":\"Wicklow\"}"
           },
           {  
              "key":"VAT_NUMBER",
              "value":"/evzaqen/"
           }
        ],
        "timezone":"Europe/Dublin",
        "tinStatus":null
     },
     {  
        "accountMode":"Live",
        "acquirer":"TEST",
        "acquirerConstraints":{  
           "cardTypes":[  
              "MASTERCARD",
              "MAESTRO",
              "VISA"
           ],
           "cvcRegexp":"^[0-9]{3}$",
           "cvcRequired":true,
           "maxAmount":500000,
           "minAmount":50
        },
        "acquirerDetails":{  
           "TEST":"test",
           "ERROR_LIST":[  
  
           ],
           "MERCHANT_CODE":"594920",
           "MID_ASSIGNED":true,
           "VALID":true,
           "_mId":"103558",
           "_status":"APPROVED",
           "acquiringMid":"1036598",
           "descriptor":"test 8885551212",
           "email":"test@gmail.com",
           "gatewayMid":"SIMP337",
           "id":"SIMP337",
           "level4Mid":"76576576",
           "name":"test",
           "status":"APPROVED",
           "transactionCurrency":"USD;EUR;GBP",
           "valid":true,
           "paymentGatewayKey":"ytfytfytfyt"
        },
        "acquirerValidations":null,
        "allowedCurrencies":[  
           "EUR",
           "USD",
           "GBP"
        ],
        "apiKeyPairs":[  
  
        ],
        "appLogoUrl":null,
        "applicationId":"949bdde5-07-d8d58f4c3d01",
        "authorizationCode":"",
        "closedDate":null,
        "closureReason":null,
        "declineAvsAddressFailure":false,
        "declineAvsZipFailure":false,
        "declineCvcFailure":false,
        "defaultCurrency":"EUR",
        "descriptor":"test85551212",
        "email":"test@gmail.com",
        "id":"9f3a7d7",
        "invitationCode":null,
        "locale":"en_US",
        "merchantApplication":{  
           "accountNumber":null,
           "acquirer":"TEST",
           "annualAmount":null,
           "annualVolume":null,
           "applicationType":"APPROVAL",
           "bankName":"UNKNOWN",
           "brand":null,
           "businessAddress":"123 test",
           "businessAddress2":null,
           "businessCity":"Atlanta",
           "businessCountry":"IRL",
           "businessPhone":null,
           "businessState":"CARLOW",
           "businessZip":null,
           "data":null,
           "email":"test@gmail.com",
           "escalationPhone":null,
           "fax":null,
           "legalName":"stest",
           "maxTransactionAmount":null,
           "mccCode":"521",
           "merchantPromotionCode":null,
           "mobile":null,
           "monthlyAmount":null,
           "monthlyVolume":null,
           "ownerFirstName":"moto",
           "ownerLastName":"test",
           "phone":"3141212",
           "GuideAccepted":null,
           "privacyAccepted":true,
           "privacyVersion":"1a",
           "referenceId":"2920",
           "routingNumber":null,
           "singleTransactionAmount":null,
           "statementName":"test",
           "taxId":null,
           "termsAccepted":true,
           "termsVersion":"1a",
           "url":null
        },
        "merchantId":"1036558",
        "merchantPromotionCode":null,
        "mposEnabled":true,
        "name":"test",
        "netonfiguration":null,
        "onboardedDate":1456846054925,
        "onboardingMethod":null,
        "onboardingStatus":"CLOSED",
        "partner":null,
        "saqCompliant":false,
        "saqExpires":null,
        "settings":[  
  
        ],
        "timezone":"Europe/Dublin",
        "tinStatus":"InCompliance"
     }
  ]
  </code></pre>
  
  <p>I want to process this file and take some of the information and populate a CSV file with it. To do this I am using the following:</p>
  
  <pre><code>import unicodecsv
  import json
  
  json_data = open("test.json")
  data = json.load(json_data)
  
  f = unicodecsv.writer(open("results.csv","wb+"))
  for entry in data:
      if "merchantApplication" in entry:
          ma = entry["merchantApplication"]
          if "email" in ma:
              f.writerow([ma["ownerFirstName"],ma["ownerLastName"],ma["email"],ma["legalName"],ma["businessAddress"],ma["businessAddress2"],ma["businessCity"],ma["businessCountry"],ma["businessState"],ma["businessZip"],ma["phone"],ma["mobile"]])
  
  json_data.close()
  </code></pre>
  
  <p>This Works fine but does not print the headers above the columns. How do I add in the headers? I am using Python 2.7.10</p>