Created
February 21, 2017 19:59
-
-
Save briandk/7434da6c2d703a0d7d4810a36630819e to your computer and use it in GitHub Desktop.
Dirk Colbry's solution for installing Seaborn on JupyterHub
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
%matplotlib inline | |
try: | |
import seaborn as sns | |
print('seaborn is already installed') | |
except: | |
try: | |
import sys | |
sys.path | |
sys.path.insert(0,'./packages') | |
import seaborn as sns | |
print('seaborn is installed in packages directory') | |
except: | |
try: | |
print('seaborn not found in local packages. Installing...') | |
!pip install -t ./packages seaborn | |
import seaborn as sns | |
except: | |
print('ERROR: unable to install seaborn') | |
sns.set(style="ticks") | |
# Load the example dataset for Anscombe's quartet | |
df = sns.load_dataset("anscombe") | |
# Show the results of a linear regression within each dataset | |
sns.lmplot(x="x", y="y", col="dataset", hue="dataset", data=df, | |
col_wrap=2, ci=None, palette="muted", size=4, | |
scatter_kws={"s": 50, "alpha": 1}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment