Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
所以我有以下代码:
columns1 = [row[d] for d in cols if d != '']
但是,它并不能阻止将空值放入列 1。
清除空值或最好完全阻止它们插入的好方法是什么?
也许你是这个意思?
columns1 = [row[d] for d in cols if row[d] != ''] ^^^^ ^