Source 1

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

⤧  Next post Maintenance WD My Cloud ⤧  Previous post Run Raspberry Pi from USB Drive