Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

The result of values_to_dict should contain columns or not? #588

Open
Zeroto521 opened this issue Jun 26, 2022 · 0 comments
Open

The result of values_to_dict should contain columns or not? #588

Zeroto521 opened this issue Jun 26, 2022 · 0 comments
Labels
idea A prototype idea

Comments

@Zeroto521
Copy link
Owner

A DataFrame likes the following.

   x  y  z
0  A  a  1
1  A  b  2
2  B  c  3
3  B  d  3
4  B  d  4

values_to_dict could return like the following.

{
    "A": {
        "a": ["1"],
        "b": ["2"],
    },
    "B": {
        "c": ["3"],
        "d": ["3", "4"],
    },
}

The above result is missing columns.
So whether the result should contain columns like the following?

{
    [
        {
            "column": "x",
            "value": "A",
            "next": [
                {
                    "column": "y",
                    "value": "a",
                    "next": {"column": "1", "value": "z"},
                },
                {
                    "column": "y",
                    "value": "b",
                    "next": {"column": "2", "value": "z"},
                },
            ],
        },
        {
            "column": "x",
            "value": "B",
            "next": [
                {
                    "column": "y",
                    "value": "c",
                    "next": {"column": "3", "value": "z"},
                },
                {
                    "column": "y",
                    "value": "d",
                    "next": [
                        {"column": "3", "value": "z"},
                        {"column": "4", "value": "z"},
                    ],
                },
            ],
        },
    ]
}
@Zeroto521 Zeroto521 added the idea A prototype idea label Jun 26, 2022
@Zeroto521 Zeroto521 changed the title A little ideas for values_to_dict The result of values_to_dict should contain columns? Jun 26, 2022
@Zeroto521 Zeroto521 changed the title The result of values_to_dict should contain columns? The result of values_to_dict should contain columns or not? Jun 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
idea A prototype idea
Projects
None yet
Development

No branches or pull requests

1 participant