摘要: 如果是数值型,那么就直接 import math x=np.nan math.isnan(x) 但是如果是str就不能这么用,会报错,因为str类型不能放在这个函数里 因为NaN六亲不认 所以可以用NaN!=NaN来进行判定。 比如你要找某个文本中的哪些词是nan 那么你就 if text!=tex 阅读全文
posted @ 2021-04-12 14:59 小千北同学超爱写代码 阅读(913) 评论(0) 推荐(0)
摘要: 在open中加入一个参数就可以, newline='\n' a = csv.writer(open(os.path.join(out_dir, file_name[:-4] + "d.csv"), 'w',newline='\n', encoding='utf-8')) a.writerows(写入 阅读全文
posted @ 2021-04-12 14:55 小千北同学超爱写代码 阅读(104) 评论(0) 推荐(0)