Pandas is a data analysis package for Python. Originally developed by AQR Capital Management in April 2008 and opened source in late 2009, it is currently continued to be developed and maintained as part of the PyData project by the PyData development Team, which focuses on Python packet development. Pandas was originally developed as a financial data analysis tool, so Pandas provides great support for time series analysis.

\

Pandas’ name comes from panel Data and Python Data Analysis. Panel data is an economic term for a cube. The data type of a panel is also provided in Pandas.

\

Return a unique value


\

  1. Pandas. Series Returns the number of unique values

    \

  2. Pandas. Series returns a unique value

\

The result is an Array:\

\

Deletes rows that meet certain criteria


\

The thinking process is as follows:

Df.drop (n, inplace=True)

The function is to find the row according to the row number N, delete the row data. Inplace =True allows the new dataframe to override the old dataframe for the deletion to take effect.

\

Next, all you need to do is return the line number that satisfies a particular condition

Correct way to write it:

\

Wrong way to write:

\

In the last step, we get the code \ that can delete lines that meet certain conditions

\

Sorting and grouping


\

Here’s the data:

\

To sort:

\

Grouping:

\

The result is as follows:

\

There are many operations for pandas. One of the most authoritative operations is to view python’s official documentation. However, after practical use, the brain will have a more profound impression. It’s okay to learn as you go along. Follow March sang, make progress every day

\

Long press the picture below to identify the QR code in the picture and pay attention to “Data analyst notes”

\