![]() |
Nu-B Q on dropna([list]) - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: Data Science (https://python-forum.io/forum-44.html) +--- Thread: Nu-B Q on dropna([list]) (/thread-27243.html) |
Nu-B Q on dropna([list]) - expat_th - May-31-2020 Hi, Probably something stupid but I can't spot it. droplist = ['City','State', 'Zip', 'Property County', 'Property State'] #This works df.dropna(subset=['City','State','Zip','Property County', 'Property State'], how ='any',axis=0) #This doesn't ? df.dropna(subset=[droplist], how ='any',axis=0) #KeyError: ['City', 'State', 'Zip', 'Property County', 'Property State'] |