Skip to content

Latest commit

 

History

History
executable file
·
67 lines (56 loc) · 1.16 KB

Pandas-Examples.md

File metadata and controls

executable file
·
67 lines (56 loc) · 1.16 KB

Add Pandas

import pandas as pd
import numpy as np
import matplotlib.pyplot as plt

Inputs output directly into notebook

%matplotlib inline

Reads CSV file from Pandas

pd.read_csv('file | url')

Gives a number of omitted values per column

drinks.isnull().sum()

Selecting a specific column

drinks.continent OR drinks['continent']

Show the first five rows

drinks.head()

Shows the first five rows, including two specific columns

drinks[['country', 'beer_servings]].head()

Show the last five rows

drinks.tail()

Describes the numeric columns (Meant values, counts, min and max, etc)

drinks.describe()

Gets the various column names

drinks.columns()

Shows the number of rows and columns in a dataset

drinks.shape

Show the number of null values for each column

drinks.isnull().sum()

Select all rows where a specific column is null

drinks[drinks['continent'].isnull()]

Get the number of counts for a specific column

drinks.continent.value_counts()