Read One Large Numpy Array
See original GitHub issueHey there, how would you recommend reading one large numpy array that does not fit into memory? I was thinking of just running:
arr=np.load(x,mmap_mode='r')
# pseudo code below
new_arr=da.concatenate([da.concatenate([arr[chunk_x,chunk_y] for chunk_x in x_chunks]) for chunk_y in y_chunks])
The chunk parts are just intervals that I’ve omitted and replaced with pseudocode to illustrate my point. Could this be done? Is there a feature to directly import numpy array? I’m not sure how the numpy stacking helps, especially if I want to use one file??
Issue Analytics
- State:
- Created 4 years ago
- Comments:14 (7 by maintainers)
Top Results From Across the Web
Efficient way to partially read large numpy file?
use numpy.load as normal, but be sure to specify the mmap_mode keyword so that the array is kept on disk, and only necessary...
Read more >Reading and writing files — NumPy v1.25.dev0 Manual
Write or read large arrays Arrays too large to fit in memory can be treated like ordinary in-memory arrays using memory mapping. Memory...
Read more >4.8. Processing large NumPy arrays with memory mapping
Memory mapping lets you work with huge arrays almost as if they were regular arrays. Python code that accepts a NumPy array as...
Read more >Sharing big NumPy arrays across python processes - Luis Sena
We'll see how to use NumPy with different multiprocessing options and benchmark each one of them, using ~1.5 GB array with random values....
Read more >Processing large NumPy arrays with memory mapping
Python code that accepts a NumPy array as input will also accept a memmap array. However, we need to ensure that the array...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Can you give a full example?
It sounds like you might just want da.from_array
On Thu, May 23, 2019 at 12:03 PM Tom Augspurger notifications@github.com wrote: