Hi all-
I would like to convert an array of named tuples to a dataframe. This can be achieved with the DataFrame
constructor when the named tuples have the same keys. However, in my case, the named tuples do not necessarily have the same keys. I would like to use missing
in cases where one named tuple does not have a key that is in another named tuple. Here is a simple example:
np = [(x=1,y=2,z=3),(x=2,y=10)]
Desired Result:
Row │ x y z
│ Int64 Int64 Int64?
─────┼───────────────────────
1 │ 1 2 3
2 │ 2 10 missing
Is there an easy way to do this? Thanks!