Data Manipulation
Reading and Writing Data
read_csv()
- Read a CSV file into a DataFrameto_csv()
- Write a DataFrame to a CSV file
Inspecting Data
head()
- Return the first n rows of a DataFrametail()
- Return the last n rows of a DataFrameinfo()
- Print a concise summary of a DataFramedescribe()
- Generate descriptive statistics of a DataFrame
Handling Missing Data
Grouping and Aggregating
groupby()
- Group a DataFrame by one or more columnspivot_table()
- Create a pivot table based on the DataFrame
Merging and Joining
Applying Functions
Data Selection
and Indexing
Selecting by Label
loc[]
- Select rows and columns by label
Selecting by Integer Position
iloc[]
- Select rows and columns by integer position
Accessing Single Values
Selecting Single Rows/Columns
xs()
- Select a single row/column by name
Retrieving Items
get()
- Retrieve item by key (or a default)
Checking Membership
isin()
- Check whether each element is contained in the values provided
Data Analysis
Descriptive Statistics
sum()
- Return the sum of the valuesmean()
- Return the mean of the valuesmedian()
- Return the median of the valuesstd()
- Return the standard deviation of the valuesvar()
- Return the variance of the valuesmin()
- Return the minimum of the valuesmax()
- Return the maximum of the values
Quantitative Analysis
count()
- Return the count of non-NA/null valuesquantile()
- Return values at the given quantile