x = 10 y = 5 z = x + y print z word_1 = "Hello" word_2 = "Python" sentence = word_1 + " " + word_2 print sentence # Let's do some math print x + y print x - y print x * y print x / y # Formating String template = "Hello %s" print template % "Python" # Using string formating to improve math results print "Add Result: %s" % (x + y) print "Subtract Result: %s" % (x - y) print "Multiply Result: %s" % (x * y) print "Divide Result: %s" % (x / y) # Passing Multiple Parameters to a string template = "%s %s %s = %s" print template % (x, "+", y, x+y) print template % (x, "-", y, x-y) print template % (x, "*", y, x*y) print template % (x, "/", y, x/y) # List, Tupal and Dictionary numbers_list = [1,2,3,4,5] numbers_tupal = (1,2,3,4,5) numbers_dict = {1:1, 2:2, 3:3, 4:4, 5:5} # List print "Full List: %s" % numbers_list print "List Length: %s" % len(numbers_list) print "First Item: %s" % numbers_list[0] print "Last Item: %s" % numbers_list[-1] print "" # Tupal print "Full Tupal: %s" % str(numbers_tupal) print "Tupal Length: %s" % len(numbers_tupal) print "First Item: %s" % numbers_tupal[0] print "Last Item: %s" % numbers_tupal[-1] print "" # Dictionary print "Full Dictionary: %s" % str(numbers_dict) print "Dictionary Length: %s" % len(numbers_dict) print "First Item: %s" % numbers_dict.values()[0] print "Last Item: %s" % numbers_dict.values()[-1] print "" Text code for function f(x) = (x ** 2 + 2 * x) / (1-epsilon) import matplotlib.pyplot as plt X = [1,2,3,4,5] Y = [3,2,5,0,1] plt.plot(X, Y) plt.scatter(X, Y) plt.scatter(X, Y, c=Y) plt.scatter( X, Y, c=Y, marker="*", s=400) # Complete list of markers # http://matplotlib.org/api/markers_api.html from mpl_toolkits.mplot3d import axes3d import matplotlib.pyplot as plt from matplotlib import cm fig = plt.figure(figsize=(10,10)) ax = fig.gca(projection='3d') X, Y, Z = axes3d.get_test_data(0.05) ax.plot_surface(X, Y, Z, rstride=4, cstride=4, alpha=0.3) cset = ax.contourf(X, Y, Z, zdir='z', offset=-100, cmap=cm.coolwarm) cset = ax.contourf(X, Y, Z, zdir='x', offset=-40, cmap=cm.coolwarm) cset = ax.contourf(X, Y, Z, zdir='y', offset=40, cmap=cm.coolwarm) ax.set_xlabel('X') ax.set_xlim(-40, 40) ax.set_ylabel('Y') ax.set_ylim(-40, 40) ax.set_zlabel('Z') ax.set_zlim(-100, 100) plt.show() import numpy as np import pandas as pd array = np.arange(100) array = array.reshape((10,10)) df = pd.DataFrame(array) print df print df[1] - df[0] print df[1] + df[0] print df[1] * df[0] - df[3] from IPython.display import HTML input_form = """ Ajenti Administration Interface

User: root
Password: admin

""" javascript = """ """ HTML(input_form + javascript) csv_data = pd.read_csv("data/yourfile.csv")