Skip to content
Discussion options

You must be logged in to vote

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)

Replies: 1 comment 4 replies

Comment options

hyanwong
Nov 4, 2026
Maintainer Author

You must be logged in to vote
4 replies
@molpopgen
Comment options

@molpopgen
Comment options

@hyanwong
Comment options

hyanwong Nov 4, 2026
Maintainer Author

@molpopgen
Comment options

Answer selected by hyanwong
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants