A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/pandas-dev/pandas/issues/924 below:

dropna able to accept a list/tuple for axis argument · Issue #924 · pandas-dev/pandas · GitHub

rationale:

I sometimes work with square matricies that potentially could have a column (and row) of all na's

I find myself doing:

df.dropna(how='all',axis=0).dropna(how='all',axis=1)

so

df.dropna(how='all',axis=[0,1])

e.g.

_dropna = DataFrame.dropna
def revised_dropna(self, axis = None, **kwargs):
    if isinstance(axis,(list,tuple)):
        return _dropna(_dropna(self,axis=axis[0],**kwargs),axis=axis[1],**kwargs)
    return _dropna(self,axis=axis,**kwargs)
DataFrame.dropna = revised_dropna

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4