Skip to content

Weird slicing behaviour #203

@callmekatootie

Description

@callmekatootie

Describe the bug

The output after slicing does not match the expectation

To Reproduce
Steps to reproduce the behavior:

const dfd = require('danfojs-node')

let data = { "Name": ["Apples", "Mango", "Banana", "Pear"] ,
           "Count": [21, 5, 30, 10] ,
           "Price": [200, 300, 40, 250] }

let df = new dfd.DataFrame(data)

let sub_df = df.iloc({rows: ["2:3"], columns: ["0:1"]})
sub_df.print()

The above code gives me the output:

image

Expected behavior

The output that I get has all the columns. Expected was only the Name column to be shown since I have sliced with "0:1" for columns

Desktop (please complete the following information):

Ubuntu 20.04

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions