Skip to content

read_excel is missing the first row of data #260

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
spleshakov opened this issue Aug 3, 2021 · 2 comments
Closed

read_excel is missing the first row of data #260

spleshakov opened this issue Aug 3, 2021 · 2 comments
Assignees

Comments

@spleshakov
Copy link

zip_code_file.xlsx

╔═══╤═══════════════════╤═══════════════════╗
║   │ Zip Code          │ County Name       ║
╟───┼───────────────────┼───────────────────╢
║ 0 │ 90001             │ LOS ANGELES       ║
╟───┼───────────────────┼───────────────────╢
║ 1 │ 90002             │ LOS ANGELES       ║
╟───┼───────────────────┼───────────────────╢
║ 2 │ 90003             │ LOS ANGELES       ║
╟───┼───────────────────┼───────────────────╢
║ 3 │ 90004             │ LOS ANGELES       ║
╚═══╧═══════════════════╧═══════════════════╝

code

const danfojs = require("danfojs-node");

(async () => {
	let df = await danfojs.read_excel(
		`${__dirname}/zip_code_file.xlsx`,
	)

	df.print()
})()

output

╔═══╤═══════════════════╤═══════════════════╗
║   │ Zip Code          │ County Name       ║
╟───┼───────────────────┼───────────────────╢
║ 0 │ 90002             │ LOS ANGELES       ║
╟───┼───────────────────┼───────────────────╢
║ 1 │ 90003             │ LOS ANGELES       ║
╟───┼───────────────────┼───────────────────╢
║ 2 │ 90004             │ LOS ANGELES       ║
╚═══╧═══════════════════╧═══════════════════╝

Issue
The first data record is missing

Additionally, I tried to explicitly specify 1st row like so

const danfojs = require("danfojs-node");

(async () => {
	let df = await danfojs.read_excel(
		`${__dirname}/zip_code_file.xlsx`,
		{
			header_index:0,
			data_index:1
		}
	)

	df.print()
})()

But got the same result like if the config was ignored

@spleshakov
Copy link
Author

Apparently, the documentation is wrong, there are no
header_index data_index properties in the code. Using this as a config instead, fixes the issue

		{
			data_num: 1,
			header: 0
		}

@risenW
Copy link
Member

risenW commented Aug 27, 2021

@spleshakov Thanks, I'll update the doc

@risenW risenW self-assigned this Sep 3, 2021
@risenW risenW closed this as completed Sep 26, 2021
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants