Skip to content

Instantly share code, notes, and snippets.

@lakshay-arora
Last active February 5, 2020 11:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lakshay-arora/4bfd12876df1361c3a0d54f142005a75 to your computer and use it in GitHub Desktop.
Save lakshay-arora/4bfd12876df1361c3a0d54f142005a75 to your computer and use it in GitHub Desktop.
# importing pandas and numpy
import pandas as pd
import numpy as np
# crete a sample dataframe
data = pd.DataFrame({
'age' : [ 10, 22, 13, 21, 12, 11, 17],
'section' : [ 'A', 'B', 'C', 'B', 'B', 'A', 'A'],
'city' : [ 'Gurgaon', 'Delhi', 'Mumbai', 'Delhi', 'Mumbai', 'Delhi', 'Mumbai'],
'gender' : [ 'M', 'F', 'F', 'M', 'M', 'M', 'F'],
'favourite_color' : [ 'red', np.NAN, 'yellow', np.NAN, 'black', 'green', 'red']
})
# view the data
data
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment