Commit dfa8ca8a authored by ferrari's avatar ferrari
Browse files

Fix nan checking with string

parent b353f865
......@@ -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()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment