I'm trying to convert my dataframe columns to arrays. For example, I have a dataframe that looks like this:
Total Price Carrier
2 3 C
1 5 D
I'd like to convert the columns to arrays like this: [[2, 1], [3,5], ['C','D]] I do not want the column names.
I've tried doing this:
df["all"] = 1
df.groupby("all")[["Total","Price", "Carrier"]].apply(list)
However, I get something like this ["Total", "Price", "Carrier"] and is an object and not an array. How can I convert all columns to arrays?