934 B
934 B
Common SQL queries in pandas
Pandas is a way to transform dataframes with the datasets you have so you have got to be comfortable using it. Make sure to import pandas and seaborn. Here are some popular commands. This website was useful for learning about that
- Import packages and load the data
# Import packages
import pandas as pd
import seaborn as sns
# Import data
tips = sns.load_dataset('tips')
- View top 5 records in the dataset
tips.head()
# specify the amount by placing number inside
# the default is 5
tips.head(8)
- Filter data
- Sort data
- Aggregate data
- Aggregate data by group
More useful data science tutorials:
- Geospatial data science and visualizations