title: python error when writing data in csv file
body: <p>write a python program to write data in .csv file,but find that every item in the .csv has a "b'" before the content, and there are blank line, I do not know how to remove the blank lines; and some item in the .csv file are unrecognizable characters,such as "b'\xe7\xbe\x85\xe5\xb0\x91\xe5\x90\x9b'", because some data are in Chinese and Japanese, so I think maybe something wrong when writing these data in the .csv file.Please help me to solve the problem
  the program is:</p>
  
  <pre><code>#write data in .csv file
  def data_save_csv(type,data,id_name,header,since = None):
      #get the date when storage data
      date_storage()
      #create the data storage directory
      csv_parent_directory = os.path.join("dataset","csv",type,glovar.date)
      directory_create(csv_parent_directory)
      #write data in .csv
      if type == "group_members":
          csv_file_prefix = "gm"
      if since:
          csv_file_name = csv_file_prefix + "_" + since.strftime("%Y%m%d-%H%M%S") + "_" + time_storage() + id_name + ".csv"
      else:
          csv_file_name = csv_file_prefix + "_"  + time_storage() + "_" + id_name + ".csv"
      csv_file_directory = os.path.join(csv_parent_directory,csv_file_name)
  
      with open(csv_file_directory,'w') as csvfile:
  
          writer = csv.writer(csvfile,delimiter=',',quotechar='"',quoting=csv.QUOTE_MINIMAL)
  
          #csv header
          writer.writerow(header)
  
          row = []
          for i in range(len(data)):
              for k in data[i].keys():
                  row.append(str(data[i][k]).encode("utf-8"))
              writer.writerow(row)
              row = []
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/cJxER.jpg" rel="nofollow noreferrer">the .csv file</a></p>