diff --git a/ipi_extract.py b/ipi_extract.py index 02babc224454ad081215db77bf56e03d9792d692..d26223907159aed977ae82128adfdb866b5b0019 100644 --- a/ipi_extract.py +++ b/ipi_extract.py @@ -287,7 +287,7 @@ class Callback(object): pos = int(FSSR*event.xdata) mpos = np.argmax(self.song_resample[max(pos-int(FSSR*FSPK),0):pos+int(FSSR*FSPK)]) + max(pos-int(FSSR*FSPK),0) if self.curr_ind[self.curr] is not None: - if np.all(np.isnan(list(self.df[self.offset[self.curr_ind[self.curr], 0]].values()))): + if np.all(pd.isnull(list(self.df[self.offset[self.curr_ind[self.curr], 0]].values()))): self.scat._facecolors[self.curr_ind[self.curr]] = [0.7, 0.2, 0.5, 1] else: self.scat._facecolors[self.curr_ind[self.curr]] = [0, 0, 0, 1] @@ -712,7 +712,7 @@ def main(args): outpath = args.out if os.path.isfile(outpath): if not (args.erase or args.resume): - print(f'Out file {outpath} already exist and erase option isn\'t set.') + print(f'Out file {outpath} already exist and erase or resume option isn\'t set.') return 1 elif args.resume: print(f'Out file {outpath} does not already exist and resume option is set.') @@ -727,7 +727,7 @@ def main(args): ref_dict['callback'].scat.set_offsets(ref_dict['callback'].offset) colors = np.array(len(ref_dict['callback'].offset)*[[0.7, 0.2, 0.5, 1]]) for i, p in enumerate(ref_dict['callback'].offset[:, 0]): - if not np.all(np.isnan(list(ref_dict['callback'].df[p].values()))): + if not np.all(pd.isnull(list(ref_dict['callback'].df[p].values()))): colors[i] = [0, 0, 0, 1] ref_dict['callback'].scat.set_color(colors) plt.draw()