Blog Logo

Python-Pandas cheat sheet: 30 functions-methods

In this blog, Jyoti Kumar covers 30 useful python-pandas functions/methods frequently used in data analysis. The functions/methods are used for loading and understanding data, selecting columns/rows or both, filtering data using one or multiple columns, sorting data and dropping a column, and summarizing data. The data used is Airlines.csv from Kaggle. Jyoti starts by loading the pandas package and then goes on to cover various functions and methods such as loading a csv file, getting the count of rows and columns in the dataframe, getting first/last few rows of the dataframe, getting data types of the columns, getting the column names as list, getting the summary stats for numeric columns, getting the count of NA values in the columns, selecting columns with data type as object/int64, getting count of values in a column, getting unique values in a column, selecting a few columns, selecting a few rows using .iloc, selecting a few rows and columns together using .loc, filtering the data using a column, filtering the data using multiple columns, filtering the data using OR conditions, filtering the data using a list, filtering the data not in the list, sorting the data using a column, renaming columns, summarising data using groupby, summarising and sorting, summarising for multiple values.