NaN Data Frame with labels and indexes

I’m trying to make a data frame of NaN with set labels and indexes. I can’t find in the documentation how to do this.

Here is what I would do in Pandas:

label = ["1T", "1G", "1C", "2T", "2G", "2A"]
rescue_left = pd.DataFrame(columns=label,index=label)

And I’d get something that looks like this:

Screen Shot 2021-09-02 at 9.54.38 AM

I was thinking I could make the matrix and then set the column labels as a vector, but I’m not sure how to set the row indexes.

Thanks for any help.


Use Pandas.jl to achieve what you want.

DataFrames.jl similarly to several other popular ecosystems providing a data frame implementation does not support row indexes. You need to create a column for storing row indexes explicitly.

Additionally maybe NamedArrays.jl or AxisArrays.jl is something that you are looking for?


Thank you for the quick response. I’ll check out those packages.