I simulated a model with different sets of parameters. To save time (not repeated run the same code with different parameters), I saved the parameters into dataframe row by row.
Now what if I just want to extract a row of it (say row 5) directly as a namedtuple?
help?> DataFrameRow
(...)
Indexing is one-dimensional like specifying a column of a DataFrame.
You can also access the data in a DataFrameRow using the getproperty
and setproperty! functions and convert it to a NamedTuple using the
copy function.
(...)
Using DataFrameRow as a NamedTuple is pretty limited - e.g. you cannot unpack it as f(; row...), cannot use tools like merging them or deleting fields, and so on. And performance, of course - getting a field from a DataFrameRow is several times slower, than from a plain named tuple.