PANDAS FILTER
Python is a great language for doing data analysis, primarily because of the fantastic ecosystem of data-centric python packages. Pandas is one of those packages and makes importing and analyzing data much easier.
Pandas dataframe.filter()
function is used to Subset rows or columns of dataframe according to labels in the specified index. Note that this routine does not filter a dataframe on its contents. The filter is applied to the labels of the index.
Syntax: DataFrame.filter(items=None, like=None, regex=None, axis=None)
Parameters:
items : List of info axis to restrict to (must not all be present)
like : Keep info axis where “arg in col == True”
regex : Keep info axis with re.search(regex, col) == True
axis : The axis to filter on. By default this is the info axis, ‘index’ for Series, ‘columns’ for DataFrameReturns : same type as input object
👇CLICK BELOW SEE EXAMPLE PROGRAMS👇
👉 EXAMPLE PROGRAMS ON PANDAS FILTER👈