In [1]:
success = True # We'll use this to keep track of the various tests
In [2]:
try:
import numpy as np
import scipy
except:
success = False
print "There was a problem importing numpy or scipy. You will definitely need these!"
In [3]:
try:
import matplotlib
import matplotlib.pyplot as plt
%matplotlib inline
except:
success = False
print "There was a problem importing matplotlib. You will definitely need this"
In [4]:
plt.plot([1, 2, 3], [1, 4, 9], "ro--")
Out[4]:
In [5]:
try:
import pandas, PyQt4, enaml
except:
success = False
print "There was a problem importing pandas, pyqt, or enaml. You will need these for Days 2 and 3."
In [6]:
try:
import h5py
from mpl_toolkits.basemap import Basemap
except:
success = False
print "There was a problem with h5py and/or Basemap. You will need these for Day 2."
In [7]:
# Basemap Test
try:
f = plt.figure(1, figsize=(14.0, 10.0))
f.suptitle("Basemap - First Map")
f.text(0.05, 0.95, "Mollewide")
f.subplots_adjust(left=0.05, right=0.95, top=0.80, bottom=0.05, wspace=0.2, hspace=0.4)
f.add_subplot(1, 1, 1)
b = Basemap(projection="moll", lon_0=0, resolution='c')
b.drawcoastlines()
b.drawparallels(np.arange( -90.0, 90.0, 20.0))
b.drawmeridians(np.arange(-180.0, 181.0, 20.0))
except:
success = False
print "There was a problem creating a Basemap plot. You will need this for Day 2."
In [8]:
if success:
print "Congratulations! Your python seems to be working properly. We look forward to seeing you at the Boot Camp!"
else:
print "There was a problem somewhere along the line. Please let us know where and we will try to help you get to the bottom of it."
In [ ]: