This article and everyone to share is mainly pandasLibrary Common FunctionsRelated content, come together to look at it, hope to everyone learn pandas helpful. 1. DataFrameHandling Missing valuesPandas. Dataframe.dropna Df2.dropna (axis=0, how= ' any ', subset=[u ' ToC '), inplace=True)put inTocrows with missing values are removed 2.calculate duplicate rows based on a dimensionPandas. Dataframe.duplicated Printdf.duplicated ([' Name ']). Value_counts () #If you do not specify a column, all columns are judged by default"""Output: False 11118 True 664indicates that there are664rows are duplicates. """UseDataFramein theDuplicatedmethod returns a Boolean type ofSeries,shows whether the rows are duplicates, and non-repeating rows are displayed asFalse, repeating rows are displayed asTrue 3.Go heavyPandas. Dataframe.drop_duplicates Df.drop_duplicates ([' Name '], keep= ' last ', inplace=true) "" " Keep: {' First’, ‘ Last', False}, default ' First’ First: Drop Duplicates except forThe FirstOccurrence. Last: Drop Duplicates except forThe LastOccurrence. False:drop AllDuplicates. "" " Source:Blog Park
Pandas of common functions of learning