While +=
doesn’t currently work, table1.extend(table2)
does work.
However, there’s a caveat: unlike NumPy arrays, catalogs aren’t necessarily stored in one block of memory, but you can only access NumPy views to catalog columns when the catalog is one contiguous block of memory. In general, when you concatenate catalogs, they won’t be contiguous, because it’ll just do a shallow copy of the records (i.e. they’ll be shared).
To do a deep copy of the records, you can use table1.extend(table2, deep=True)
- but even that won’t give you a contiguous catalog when concatenating, because it won’t reallocate all of the existing records in table1.
The easiest way to get a contiguous catalog is to just copy the result after concatenating:
table1.extend(table2)
table1.extend(table3)
...
result = table1.copy(deep=True)