topic
brief_alternate.pdf
superstore_transaction.csv
Thought:
Self -studypandasData processing,Beforeimport csv
Make much more useful。
What the knowledge point needs to be remembered is:
- df[“Name”] You can directly determine the first line as the name listed,并且返回一个只包含Nameof列表。
- idxmax()Return to the maximum valueindex,max()Maximum meal
.loc
The function is pandas An important function in it,Used to select and locate data in the data box。It allows you to choose some lines and columns,To make it DataFrame or Series Back to form。
By using the line label and column label as the index,You can perform the following operations in the data box:
.Choose a single line of data
.Choose multi -line data
.Select single -column data
.Select multiple columns of data
grammar:df.loc[row_indexer, column_indexer]
in,row_indexer Is the label to choose a line,column_indexer Is the label of the column to be selected。- unique()Return without duplicationvalueofnumbercount。
code show as below:
1 | # Import pandas library as pd |
1 | import requests |
1 | import pandas as pd |