The general function of Pandas learning

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.