Skip to content

DataFrame.query() resets the column names. #302

Closed
@sanchaz

Description

@sanchaz

Describe the bug
DataFrame.query() by string resets the columns to 0, 1, 2, ...
https://danfo.jsdata.org/api-reference/dataframe/danfo.dataframe.query#query-by-a-string-column-in-a-dataframe
According to the docs the columns should remain there.

To Reproduce
https://danfo.jsdata.org/api-reference/dataframe/danfo.dataframe.query#query-by-a-string-column-in-a-dataframe
Copy the example posted and run it.

However if you use inplace: true then the behaviour is correct.
Seems the issue is that when returning a new df it forgets to copy the columns.

Expected behavior
Column names should remain the same.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: Ubuntu 20.04
  • Browser Firefox
  • Version 93.0 (64-bit)

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions