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

frame.assign.apply_element dtype argument not working when selection is multiple columns #842

Open
chaburkland opened this issue Sep 5, 2023 · 0 comments

Comments

@chaburkland
Copy link
Collaborator

Description

The dtype argument to sf.Frame.assign.apply_element doesn't behave as expected when the selection contains multiple columns.

Example

from datetime import date
import static_frame as sf

frame = sf.Frame.from_records(
    [
        ["2023-01-01", "2023-02-01"],
        ["2023-01-02", "2023-02-02"],
        ["2023-01-03", "2023-02-03"],
    ],
    columns=["A", "B"],
)

single = frame.assign["A"].apply_element(date.fromisoformat, dtype="datetime64[D]")
multiple = frame.assign[["A"]].apply_element(date.fromisoformat, dtype="datetime64[D]")

assert single['A'].dtype == 'datetime64[D]'
assert multiple['A'].dtype == object

Platform

17:15:58 Out [13] 
<Series: platform>
<Index>
platform           Linux-5.4.0-156-generic-x86_64-with-glibc2.29
sys.version        3.8.12 (default, Aug 30 2023, 21:17:56) [GCC 9.4.0]
static-frame       1.6.0
numpy              1.24.3
pandas             1.5.3
xlsxwriter         3.1.0
openpyxl           3.0.9
xarray             <ModuleNotFoundError>
tables             3.8.0
pyarrow            0.17.1
msgpack            (1, 0, 0)
msgpack_numpy      None
<<U13>             <object>
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

1 participant