title: How do I replace empty cells from this excel file while I turn it into csv?
body: <p>I am trying to change this excel file into csv and I would like replace empty cells with Nan. Also do you have any advice on how to clean up the data from excel better? My Code so far: </p>
  
  <pre><code>sheet1 = wb.sheet_by_index(1)
  with open("data%s.csv" %(sheet1.name.replace(" ","")), "w", encoding='utf-8') as file:
      writer = csv.writer(file, delimiter = ",")
      header = [cell.value for cell in sheet1.row(1)]
      writer.writerow(header)
      for row_idx in range(2, sheet1.nrows):
          row = [int(cell.value) if isinstance(cell.value, float) else cell.value
                  for cell in sheet1.row(row_idx)]
          writer.writerow(row)
  </code></pre>