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

fix: from_rows #118

Merged
merged 1 commit into from
Sep 12, 2023
Merged

fix: from_rows #118

merged 1 commit into from
Sep 12, 2023

Conversation

universalmind303
Copy link
Collaborator

closes #20

note: the explicit schema is required if you want to retain the null values.

// this will drop the null column if all values of "c" are null
> pl.DataFrame([{a:1, b:2, c:null}])

shape: (1, 2)
┌─────┬─────┐
 a    b   
 ---  --- 
 f64  f64 
╞═════╪═════╡
 1.0  2.0 
└─────┴─────┘
// this will strictly use the schema provided.
> pl.DataFrame([{a:1, b:2, c:null}], {
  schema: { a: pl.Int32, b: pl.Int32, c: pl.Utf8 },
  orient: "row",
});

shape: (1, 3)
┌─────┬─────┬──────┐
 a    b    c    
 ---  ---  ---  
 i32  i32  str  
╞═════╪═════╪══════╡
 1    2    null 
└─────┴─────┴──────┘

@universalmind303 universalmind303 merged commit a22a0d7 into main Sep 12, 2023
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

Successfully merging this pull request may close these issues.

Cannot create dataframe containing null values
1 participant