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
import matplotlib.pyplot as plt | |
%matplotlib inline | |
plt.figure(figsize=(12,8)) | |
nx.draw_networkx(df, with_labels=True) |
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
import networkx as nx | |
df = nx.from_pandas_edgelist(data, source='Origin', target='Dest', edge_attr=True) | |
df.nodes() | |
df.edges() |
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
data.head() |
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
import pandas as pd | |
import numpy as np | |
data = pd.read_csv("data.csv") |
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
# 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): |
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
sns.catplot(x="age", y="avg_training_score", data=df2, kind="boxen",height=4, aspect=2.7, hue = "is_promoted") |
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
corrmat = df2.corr() | |
f, ax = plt.subplots(figsize=(9, 6)) | |
sns.heatmap(corrmat, vmax=.8, square=True) |
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
sns.jointplot(x="age", y="avg_training_score", data=df2, kind="kde"); |
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
sns.jointplot(x=df2.age, y=df2.avg_training_score, kind="hex", data = df2) |
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
sns.pairplot(df2) |