represent_nd_columns_as_1d_columns#
- astropy.table.represent_nd_columns_as_1d_columns(tbl, copy=False)[source]#
Represent any N-D columns in a table as multiple 1-D columns.
This function represents (or “flattens”) any N-D columns in
tblas multiple 1-DColumnobjects and returns a new Table.The schema for transforming N-D to multiple 1-D is to create new column names by appending the indices of the N-D column to the original column name, separated by a dot. For example, a 2-D column named
datawith shape (3, 4) would be represented as 12 1-D columns nameddata.0_0,data.0_1, …,data.2_3.If any of these new column names conflict with existing column names, underscores are appended to the base name until the conflict is resolved. For example, if a column named
data.0_0already exists, the new column would be nameddata_.0_0. If that also exists, the new column would be nameddata__.0_0, and so on.