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

Int DataFrame column names are being converted to float string representation #901

Closed
kuroski opened this issue Oct 11, 2023 · 2 comments
Closed
Assignees
Labels

Comments

@kuroski
Copy link

kuroski commented Oct 11, 2023

Hello, I was working with the following scenario in a notebook.

import pandas as pd
import numpy as np

df = pd.DataFrame(np.random.rand(100, 2))

In this example, I have two int columns 0 and 1.

When trying to plot the DataFrame

from lets_plot import *
ggplot(df) + geom_point(aes(x="0", y="1"))

I am presented with the following error message:

Variable not found: '0'. Variables in data frame: ['0.0', '1.0']

It seems for some reason, the names are being converted to a float string representation.

image

@alshan alshan added this to the New milestone Oct 11, 2023
@Zaf4
Copy link

Zaf4 commented Nov 4, 2023

I checked and it's not a problem with lets_plot. It's a pandas problem. I used the same array and pandas dataframe got errors both in lets_plot and seaborn. But, when you convert the same dataframe to polars dataframe, both seaborn and lets_plot works.

df_pd = pd.DataFrame(np.random.rand(100, 2))
df_pl = pl.from_pandas(df_pd)

Seaborn Example

image

Lets_plot Example

image

@alshan alshan modified the milestones: New, 2023Q4 Nov 7, 2023
@alshan
Copy link
Collaborator

alshan commented Nov 7, 2023

Related: #626

@alshan alshan closed this as completed Nov 7, 2023
@alshan alshan reopened this Nov 7, 2023
@alshan alshan modified the milestones: 2023Q4, 2024Q1 Dec 29, 2023
@alshan alshan modified the milestones: 2024Q1, 2024Q2 Mar 29, 2024
@alshan alshan added the * label Apr 13, 2024
@IKupriyanov-HORIS IKupriyanov-HORIS self-assigned this Jun 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants