danfojs icon indicating copy to clipboard operation
danfojs copied to clipboard

readExcel offsetting columns with null values

Open daniel-odc opened this issue 2 years ago • 0 comments

Hi first of all, many thanks for this great library. I have an issue with the readExcel method:

When a table has null values, readExcel seems to shift the values from right to left and sometimes remove columns. The readCSV method works as expected with the same data.

Row data in Excel image

Loaded data after readCSV (OK, works as expected) image

Loaded data after readExcel ==> the values are shifted to the left where there are empty values and the column Adresse has disapeared. image

To Reproduce

  1. I am using Danfo in a React application
  2. Code:
import { readExcel, readCSV } from "danfojs";

export const TestPage = () => {

    const url_excel = 'https://storage.googleapis.com/bucket-test-odc/file_naVal_xls.xlsx';
    const url_csv = 'https://storage.googleapis.com/bucket-test-odc/file_naVal_csv.csv';
    
    async function load_process_data() {
        let dfCsv = await readCSV(url_csv);
        let dfXls = await readExcel(url_excel);

        console.log('****** readCSV: ***********')
        dfCsv.head().print();

        console.log('****** readExcel: ***********')
        dfXls.head().print();
    }

    load_process_data();

    return (
        <>tests ok</>
    )
}

My dev environment

  • Windows 10
  • Chrome
  • React 18.2.0

Attached the 2 files for reproduction (also available in a public bucket as stated in the code). file_naVal_csv.csv file_naVal_xls.xlsx

Many thanks for your help.

daniel-odc avatar May 24 '23 12:05 daniel-odc