Pandas Web page Operation Basics

Source: Internet
Author: User

Ipython Notebook

Command line Input Ipython notebook

At this point, the browser will automatically run and open the Ipython Web page

Basic operations

As shown, create a new project

Import related modules, set up a data set

Create a missing item and assign a value to the newly inserted part

This constructs a two-dimensional dataframe array that contains some empty data

There are generally two ways to process empty data

Dropna (), Fillna (values=5) with null values removed to replace null values with default values

Pd.isnull (DF1) can determine whether an element is empty data, plus any (). any () Boolean value that can be used for null data

Average calculation by column: (null value not participating in calculation)

Average calculation by row: (null value not participating in calculation)

Accumulate Values by column: (null value does not participate in calculation)

When subtracting an array of two dimensions, the subtracted array copies the dimensions of the current column complement the set of the meiosis, and the null value does not participate in the operation

Accumulate by line

Maximum value minus minimum for each column

The Apply function enters a sequence

Value_counts () View the number of occurrences of an element with. Mode () View the most frequently occurring elements

Create a random sequence first

Call Value_counts ()

Call. Mode () to see the most frequently occurring elements

Data merge

Create an array of 10*4 first

(1) Call the concat () function to merge the array (Concat accepts an array, which is the array to be merged)

See if the merged array is equal to the original array

Or

(2) Merge through merge, similar to table join Association

Create two arrays First

Call merge, which is equivalent to select * from the left inner join right on left.key = Right.key;

(3) Insert method Merge array

Create an array first

Call Append, if the number of inserted columns is different, the missing value

Classification statistics

Create an array first

A single pair of ' a ' groups, GroupBy (' a ')

Multi-Group, GroupBy ([])

Pandas Web page Operation Basics

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.