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

Int64 (Uppercase 'I') in Python Not Handled by Data Explorer, While int64 (Lowercase 'i') Is #5066

Closed
msberends opened this issue Oct 18, 2024 · 4 comments
Assignees
Labels
area: data explorer Issues related to Data Explorer category. bug Something isn't working lang: python support

Comments

@msberends
Copy link

System details:

Positron and OS details:

Positron Version: 2024.10.0 (Universal) build 14
Code - OSS Version: 1.93.0
Commit: 901ab5d
Date: 2024-10-09T15:26:55.363Z
Electron: 30.4.0
Chromium: 124.0.6367.243
Node.js: 20.15.1
V8: 12.4.254.20-electron.0
OS: Darwin arm64 24.0.0

Interpreter details:

Python 3.9.6

Describe the issue:

Int64 (uppercase I) is not handled by the data explorer, while int64 (lowercase i) is.

Steps to reproduce the issue:

df.dtypes
# USMER                    Int64
# MEDICAL_UNIT             int64
# SEX                      Int64
# PATIENT_TYPE             Int64
# DATE_DIED               object
# INTUBED                  Int64
# PNEUMONIA                Int64

No histograms for the Int64 columns, but instead question marks:

Image

Filter options for numeric int64 column:

Image

But not for numeric Int64 column:

Image

Expected or desired behavior:

One could argue that Int64 was wrongly coded, but the problem is that Python does support this (as opposed to R). So I believe the Positron data explorer should support this uppercase 'I' for numeric columns as well.

Were there any error messages in the UI, Output panel, or Developer Tools console?

No, UI problem.

@testlabauto
Copy link
Contributor

Hi! Thank you for your bug report. I am able to repro with:

import pandas as pd
import numpy as np

df = pd.DataFrame({
    'col1': np.random.randint(1, 10, 5),
    'col2': np.random.randint(10, 20, 5)
}, dtype='Int64')

print(df)

I am moving this issue to triage for prioritization.

@testlabauto testlabauto added area: data explorer Issues related to Data Explorer category. lang: python labels Oct 18, 2024
@juliasilge juliasilge added bug Something isn't working support labels Oct 19, 2024
@jmcphers jmcphers added this to the 2024.12.0 Pre-Release milestone Oct 21, 2024
@jmcphers
Copy link
Collaborator

Triage: we think this will be relatively straightforward to address, please kick back if it turns out to be otherwise.

@wesm wesm self-assigned this Oct 21, 2024
wesm added a commit that referenced this issue Oct 23, 2024
…ing (#5145)

Addresses #5066. This adds type mappings for pandas's Nullable data
types, so that `Int64`, `Float64`, and friends are recognized as numbers
so data type sigils, statistics/sparklines, filters show up correctly.
@testlabauto
Copy link
Contributor

Verified Fixed

Positron Version(s) : 2024.11.0-103
OS Version          : OSX

Test scenario(s)

import pandas as pd
import numpy as np

df = pd.DataFrame({
    'col1': np.random.randint(1, 10, 5),
    'col2': np.random.randint(10, 20, 5)
}, dtype='Int64')

print(df)

Link(s) to TestRail test cases run or created:

@msberends
Copy link
Author

You guys are absolutely awesome 🤩🤩

Just took an AI Bootcamp where I briefly took the liberty to show(case) Positron in front of the group, it’s easy for many to fall in love instantly!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: data explorer Issues related to Data Explorer category. bug Something isn't working lang: python support
Projects
None yet
Development

No branches or pull requests

5 participants