This file contains hidden or 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
# multi linechart | |
# small multiple line charts | |
# heatmap - categorical | |
# heatmap - numeric |
This file contains hidden or 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
# helper func | |
def hi_frame(frame): | |
print('Nice meeting you!╰( ´・ω・)つ──☆✿✿✿✿✿✿') | |
print('A little bit abt me, I am...\n') | |
print('{row} rows X {col} columns'.format(row=frame.shape[0], col=frame.shape[1])) | |
print('==================================') | |
print(frame.dtypes) | |
return frame.head(5) | |
def hi_frames(frame, frame2): |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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
# run this or you cannot see the viz | |
python -m SimpleHTTPServer 8000 |
This file contains hidden or 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
#### BASIC ######################################################################################################################## | |
# 🐼cleaning str in the header | |
df.columns = [x.lower().strip() for x in df.columns] # lower case, trim leading and trailing spaces | |
df.columns = df.columns.str.replace(' ','') # remove all whitespaces | |
# checking NaN in all df | |
df.isnull().values.any() | |
# get column-slices |
This file contains hidden or 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
%matplotlib inline | |
import pandas as pd | |
import matplotlib.pyplot as plt | |
import numpy as np | |
df = pd.read_csv("sample.csv") | |
plt.style.use('spe') |
This file contains hidden or 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
######### setting fig size | |
# Get current size | |
fig_size = plt.rcParams["figure.figsize"] | |
# Prints: [8.0, 5.0] | |
print "Current size:", fig_size | |
# Set new figure width to 8 and height to 5 | |
fig_size[0] = 8 | |
fig_size[1] = 5 |