Last active
February 5, 2020 11:02
-
-
Save lakshay-arora/4bfd12876df1361c3a0d54f142005a75 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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