Python Pandas Methods for Data Analysis
import pandas as pd
import numpy as np
df # Our Main DataFrame
df_country_group = df.groupby('Country')
df_country_group.mean()
df_country_group.get_group('Germany')
# Faster as df[df['Country'] == 'Germany']
# Test it in Jupyter Notebooks with %%timeit
df.nlargest(N, column_name, keep = 'first')
df.nlargest(3,'Number of Laptops')
# Same principle to nsmallest()
Then we have some logical comparation methods
- ”<” : “.lt()”
- ”>” : “.gt()”
- ”<=” : “.le()”
- ”>=” : “.ge()”
- ”==” : “.eq()”
- ”!=” : “.ne()”
This post will be completed