Skip to main content
 首页 » 编程设计

python之使用 n^2 位空间的二维 bool 数组

2024年11月01日11JeffreyZhao

<分区>

我需要一个 2d n x n bool 数组,它使用尽可能接近 n^2 位的内存。我需要的操作是能够快速设置和读取由 (x,y) 坐标索引的各个位。有没有在 python 和/或 numpy 中执行此操作的好方法?