Pandas_Notes_Design
Pandas_Notes_Design
Pandas is a powerful library for data manipulation in Python, widely used in Machine Learning
projects.
This document contains the most commonly used pandas methods with explanations and examples.
Data Loading
Example: pd.read_csv()()
Example: pd.read_excel()()
Example: pd.read_json()()
Example: pd.read_sql()()
Example: pd.read_html()()
Data Inspection
Example: df.head(n)()
Example: df.tail(n)()
Example: df.info()()
df.describe() - Statistical summary
Example: df.describe()()
Example: df.shape()
Example: df.columns()
Example: df.dtypes()
Data Cleaning
Example: df.isnull()()
Example: df.dropna()()
Example: df.fillna(value)()
Example: df.duplicated()()
Example: df.drop_duplicates()()
Example: df.rename()()
Data Selection
Example: df.loc[]()
Example: df.iloc[]()
Example: df.at[]()
Example: df.iat[]()
Data Filtering
Example: df.query()()
Example: df[df['column'].isin()]()
Data Transformation
Example: df.apply()()
Example: df.map()()
df.replace() - Replace values
Example: df.replace()()
Example: df.astype()()
Example: df.sort_values()()
Example: df.groupby()()
Example: df.agg()()
Example: df.pivot_table()()
Example: df.crosstab()()
Example: pd.concat()()
Example: pd.merge()()
Example: df.join()()
Data Visualization
df.plot() - Simple plotting
Example: df.plot()()
Example: df.hist()()
Example: df.boxplot()()
Exporting Data
Example: df.to_csv()()
Example: df.to_excel()()
Example: df.to_json()()
Example: df.to_sql()()
Conclusion
These are the essential pandas methods used in Machine Learning projects.