[英]How to deal with null row appended at the end of windows generated csv?
I wrote a function to deal with the null values in the csv before passing it to a forecasting model我写了一个函数来处理 csv 中的空值,然后再将其传递给预测模型
if do_nulls_exist == True:
print('found a null value')
null_rows = pd.isnull(data)
print('######### ORIGINAL ROWS THAT NEED UPDATING ##############')
print(null_rows)
# Need to add 2 to each value in null_rows because there
print('######### ROWS + 2 = ACTUAL ROW NUMBERS IN CSV ##############')
update_these_rows = []
for x in null_rows:
update_these_rows.append(int(x)+2)
print(update_these_rows)
emit('error', {'data': update_these_rows})
As you can see the there is a null row appended at the end (Row no 36)如您所见,末尾附加了一个空行(第 36 行)
Pls guide me as to how I can remove this null row.请指导我如何删除这个空行。 Thanks!
谢谢!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.