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] != ''] ^^^^ ^