title: Pandas - CSV to Dataframe (Column encoded with Base64)
body: <p>The following code is used to ingest firewall logs from a csv into a dataframe using Pandas.</p>
  
  <pre><code>df = pd.read_csv('/Users/alistairgillespie/Documents/Projects/COMP5310/Akamai Data/FINAL/data.csv', dtype = {"_time": str, "city": str,"country": str,"lat": str,"long": str,"region": str,"UA": str,"bytes": str,"cliIP": str,"reqHost": str, "reqMethod": str, "reqPath": str,"reqPort": str,"respCT": str,"respLen": str,"status": str,"referer": str,"date": str,"conn": str,"denyData": str,"denyRules": str,"policy": str,"ruleSet": str,"warnRules": str,"warnData": str,"warnSlrs": str,"warnTags": str})
  </code></pre>
  
  <p>* Excuse the long line of columns</p>
  
  <p>Once in the dataframe, I am wanting to iterate over each row and decode the 'denyData' column fields (if not NaN) using unquote and base64decode function calls. I am trying to do this with the following code:</p>
  
  <pre><code>for i, row in df.iterrows():
      print(pd.notnull(row))
      temp = parse.unquote(row['denyData'])
      new = base64.b64decode(temp)
      df2.loc[i, 'denyData'] = new
  </code></pre>
  
  <p>The following error is produced: </p>
  
  <pre><code>TypeError: argument of type 'float' is not iterable
  </code></pre>
  
  <p>What is the correct way of processing byte columns from csv into Pandas dataframes and is this the correct approach to cleaning such data? An example of the data follows.</p>
  
  <p><a href="https://i.stack.imgur.com/uNTZH.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/uNTZH.png" alt="Example of the column with encoded data"></a></p>