Gmousse / dataframe-js

No Maintenance Intended
https://gmousse.gitbooks.io/dataframe-js/
MIT License
460 stars 38 forks source link

[BUG] Creating new DataFrame from array with duplicate column names #126

Open isaac-eiter opened 3 years ago

isaac-eiter commented 3 years ago

Describe the bug A clear and concise description of what the bug is.

To Reproduce Steps to reproduce the behavior:

  1. Create data array with random values, eg: [[1,2,3] , [4,5,6]]
  2. Create column array with duplicates, eg: ["Column1" , "Column2" , "Column1"]
  3. Create new DataFrame object
  4. The values in the DataFrame will be: [["Column1" , "Column2"] , [3,2] , [6,5]]

Expected behavior I would expect either an exception to be thrown "Duplicate columns detected, loss of data" or the second "Column1" to have a name such as "Column1-Duplicate1"

Desktop (please complete the following information):

Additional context This generally isn't a problem once up and running, but I am using this api to read/write from google sheets by creating each sheet as a DataFrame. Any duplication of columns would be undetected and result in loss of data