Skip to content

Instantly share code, notes, and snippets.

View shubham-singh-ss's full-sized avatar

Shubham Singh shubham-singh-ss

View GitHub Profile
import matplotlib.pyplot as plt
%matplotlib inline
plt.figure(figsize=(12,8))
nx.draw_networkx(df, with_labels=True)
import networkx as nx
df = nx.from_pandas_edgelist(data, source='Origin', target='Dest', edge_attr=True)
df.nodes()
df.edges()
data.head()
import pandas as pd
import numpy as np
data = pd.read_csv("data.csv")
# Initialize the FacetGrid object
g = sns.FacetGrid(df2, row="gender", hue="gender", aspect=5, height=3)
# # Draw the densities in a few steps
g.map(sns.kdeplot, "age", shade=True, alpha=1, lw=3.5, bw=.2)
g.map(sns.kdeplot, "age", color="w", lw=2, bw=.2)
g.map(plt.axhline, y=0, lw=2)
# # Define and use a simple function to label the plot in axes coordinates
def label(x, color, label):
sns.catplot(x="age", y="avg_training_score", data=df2, kind="boxen",height=4, aspect=2.7, hue = "is_promoted")
corrmat = df2.corr()
f, ax = plt.subplots(figsize=(9, 6))
sns.heatmap(corrmat, vmax=.8, square=True)
sns.jointplot(x="age", y="avg_training_score", data=df2, kind="kde");
sns.jointplot(x=df2.age, y=df2.avg_training_score, kind="hex", data = df2)
sns.pairplot(df2)