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

feat(python)!: Read 2D NumPy arrays as Array type instead of List #16710

Merged
merged 1 commit into from
Jun 4, 2024

Conversation

ritchie46
Copy link
Member

@ritchie46 ritchie46 commented Jun 4, 2024

Closes #16512

Two-dimensional NumPy arrays are now read as Array types instead of List types.

Example

Before:

>>> import numpy as np
>>> arr = np.array([[1, 2], [3, 4]])
>>> pl.Series(arr)
shape: (2,)
Series: '' [list[i64]]
[
        [1, 2]
        [3, 4]
]

After:

>>> import numpy as np
>>> arr = np.array([[1, 2], [3, 4]])
>>> pl.Series(arr)
shape: (2,)
Series: '' [array[i64, 2]]
[
        [1, 2]
        [3, 4]
]

@ritchie46 ritchie46 added this to the 1.0.0 milestone Jun 4, 2024
@github-actions github-actions bot added breaking Change that breaks backwards compatibility enhancement New feature or an improvement of an existing feature python Related to Python Polars labels Jun 4, 2024
@ritchie46 ritchie46 merged commit 7e5db3d into main Jun 4, 2024
15 checks passed
@ritchie46 ritchie46 deleted the array branch June 4, 2024 09:03
@stinodego stinodego changed the title feat(python)!: Read 2D numpy arrays as Array[dt, shape] instead of Listst[dt] feat(python)!: Read 2D NumPy arrays as multidimensional Array instead of List Jun 12, 2024
@stinodego stinodego changed the title feat(python)!: Read 2D NumPy arrays as multidimensional Array instead of List feat(python)!: Read 2D NumPy arrays as Array type instead of List Jun 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking Change that breaks backwards compatibility enhancement New feature or an improvement of an existing feature python Related to Python Polars
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Series constructor: 2D array to Array instead of List.
1 participant