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

Large int64 rendered as negative number #546

Open
sbatururimi opened this issue Sep 12, 2024 · 1 comment
Open

Large int64 rendered as negative number #546

sbatururimi opened this issue Sep 12, 2024 · 1 comment

Comments

@sbatururimi
Copy link

Hi. If a pandas dataframe column contains large int64 numbers the DataGrid renders some of them as negative numbers.

data = {
    'A': np.random.randint(1e15, 1e18, size=10, dtype='int64'),
    'B': np.random.randint(1e15, 1e18, size=10, dtype='int64'),
}

test_df = pd.DataFrame(data)

grid = DataGrid(test_df, layout={'height': '600px'}, 
                base_column_size=100, 
                base_row_size=32, 
                selection_mode='cell',
               )
grid
Screenshot 2024-09-12 at 11 48 08

While transforming such columns into str solve the problem, it then takes a lot of time to construct and render the DataGrid. Any solution for that?

@andrewgross
Copy link

Seems like pandas views the int64 as an unsigned representation, while DataGrid is using a signed representation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants