I’m curious why the following method for creating a DataFrame using an existing matrix doesn’t exist. In some ways it seems like the simplest way to create a DataFrame.
using DataFrames mat = rand(10000,3) df = DataFrame(mat, [:a, :b, :c], copycols=false)
I have a large matrix and I’d like to use a DataFrame to label and operate on the columns inplace - either to avoid an expensive copy or just to make modifying the original matrix more convenient through the DataFrame API.
Btw, the following workaround seems to save the copy, but I’m wondering if there’s something I’m missing:
matcols = collect(eachcol(mat)) df = DataFrame(matcols, [:a, :b, :c], copycols=false);