Repository navigation
|
When I do something like |
Replies: 1 comment 4 replies
|
I asked chatGPT! If this is an immutable table (e.g. ts.tables.XXXX) as in the example above, then slicing ( (edit - as per @molpopgen 's comments below, the slice notation this does have to make a new lightweight table wrapper, but it doesn't have to copy the table contents) |
I asked chatGPT! If this is an immutable table (e.g. ts.tables.XXXX) as in the example above, then slicing (
ts.tables.nodes[100:1000]) creates a numpy view which is zero-copy. But fancy indexing (ts.tables.nodes[1,4,5]) is not zero-copy, although it is lazy (i.e. it only makes the new copy on access).(edit - as per @molpopgen 's comments below, the slice notation this does have to make a new lightweight table wrapper, but it doesn't have to copy the table contents)