Looping through Dask array made of npy memmap files increases RAM without ever freeing it

Context I am trying to load multiple .npy files containing 2D arrays into one big 2D array to process it by chunk later.All of this data is bigger than my RAM so I am using the memmap storage/loading system here: pattern = os.path.join(FROM_DIR, '*.npy') paths = sorted(glob.glob(pattern)) arrays = [np.load(path, mmap_mode='r') for path in paths] … Read more

How to modify one column’s null values based on another column?

I have 12 columns of ingredients and 12 respective columns of measurements of those ingredients. For some rows the ingredients are specified but the measurements are not i.e. they are NA. I want to set up a condition such that if a certain ingredient entry is not NA and the corresponding entry is NA, set the corresponding measurement entry to 1.

How to return multiple values from a request using FastAPI?

I’m trying to create an API using FastAPI + MongoDB that can return multiple values from the request. The MongoDB is full of data and using mongoengine I can consult one or all data when sending a request to the specific endpoint.
What I’m trying to do now is receive one or more data from an endpoint, for example: