From b81bbed41c8e6c413f6fda64885f4a6eab3d7922 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Al=C3=A1n=20Mu=C3=B1oz?= <alan.munoz@ed.ac.uk> Date: Wed, 28 Sep 2022 00:46:40 +0100 Subject: [PATCH] refactor(signal): replace np -> bn --- src/agora/io/signal.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/agora/io/signal.py b/src/agora/io/signal.py index 673b1304..f5976a4f 100644 --- a/src/agora/io/signal.py +++ b/src/agora/io/signal.py @@ -2,6 +2,7 @@ import typing as t from copy import copy from pathlib import PosixPath +import bottleneck as bn import h5py import numpy as np import pandas as pd @@ -79,7 +80,7 @@ class Signal(BridgeH5): @staticmethod def get_retained(df, cutoff): - return df.loc[df.notna().sum(axis=1) > df.shape[1] * cutoff] + return df.loc[bn.nansum(df.notna(), axis=1) > df.shape[1] * cutoff] def retained(self, signal, cutoff=0.8): -- GitLab