title: ValueError: Invalid file path or buffer object type: <class 'pandas.core.frame.DataFrame'>
body: <p>I want to export my dataset. When running the below code I'm getting the following error:</p>
  <p><code>ValueError: Invalid file path or buffer object type: &lt;class 'pandas.core.frame.DataFrame'&gt;</code></p>
  <p>Code :</p>
  <pre><code>list_kalimat = []
  nomor_kalimat = 1
  
  # open file in read mode
  with open('SINGGALANG.tsv', encoding='UTF-8') as read_obj:
      # pass the file object to reader() to get the reader object
      csv_reader = csv.reader(read_obj, delimiter='\t', quotechar=None)
      
      # Iterate over each row in the csv using reader object
      for row in csv_reader:
          # row variable is a list that represents a row in csv
          if len(row) == 0:
              nomor_kalimat += 1 
          else:
              tmp_row= row
              tmp_row.append(nomor_kalimat)
              list_kalimat.append(tmp_row)
  
  dataset = pd.DataFrame(list_kalimat, columns=['token', 'entitas bernama', 'kalimat'])
  dataset.to_csv(dataset, index=False, columns=['token'])
  </code></pre>