This file contains hidden or 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 logging | |
| from pylons import config, request, response, session, tmpl_context as c | |
| from pylons.controllers.util import abort, redirect_to, url_for | |
| from rpxclock.lib.base import BaseController, render | |
| log = logging.getLogger(__name__) | |
| import urllib2 |
This file contains hidden or 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
| from sforce.enterprise import SforceEnterpriseClient | |
| h = SforceEnterpriseClient('/home/user/.conf/enterprise.wsdl.xml') | |
| h.login('[email protected]', 'password', 'securitytoken') | |
| lead = h.generateObject('Lead') | |
| lead.FirstName = 'Masayoshi' | |
| lead.LastName = 'Nakamura' | |
| lead.Company = 'Masasushi, Inc.' | |
| lead.Email = '[email protected]' | |
| result = h.create(lead) |
This file contains hidden or 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
| Git練習用 | |
| Git練習用 | |
| Git練習用 | |
| Git練習用 | |
| Git練習用 | |
| Git練習用 | |
| Git練習用 | |
| Git練習用 | |
| Git練習用 | |
| Git練習用 |
This file contains hidden or 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
| sum = 0 | |
| for i in range(1, 11): | |
| sum = sum + i | |
| print sum |
This file contains hidden or 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
| class Stuffy(object): | |
| def __init__(self, s = None): | |
| self.buffer = s | |
| def eek(self): | |
| return self.buffer | |
| if __name__ == '__main__': | |
| s1 = Stuffy(10) | |
| s2 = Stuffy(20) |
This file contains hidden or 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 sys | |
| if __name__ == '__main__': | |
| print sys.argv |
This file contains hidden or 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
| $ source virtualenvwrapper.sh | |
| $ lsvirtualenv | |
| bootcamp1 | |
| $ workon bootcamp1 | |
| (bootcamp1)$ lssitepackages | |
| dateutil pylab.pyc | |
| easy-install.pth pytz | |
| matplotlib scikit_learn-0.12-py2.7.egg-info | |
| matplotlib-1.1.1-py2.7.egg-info scipy | |
| mpl_toolkits scipy-0.11.0-py2.7.egg-info |
This file contains hidden or 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
| Irisデータセットの取得 | |
| Shellから | |
| $ wget http://archive.ics.uci.edu/ml/machine-learning-databases/iris/iris.data | |
| GUIから | |
| ブラウザで http://archive.ics.uci.edu/ml/machine-learning-databases/iris/iris.data を開き、データをダウンロード |
This file contains hidden or 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 numpy as np | |
| from sklearn import linear_model | |
| import matplotlib.pyplot as plt | |
| X = np.array([[0], [1], [2], [3]]) | |
| Y = np.array([0.1, 1.1, 1.8, 2.7]) | |
| regr = linear_model.LinearRegression() | |
| regr.fit(X, Y) |
This file contains hidden or 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 numpy as np | |
| from sklearn import linear_model | |
| import matplotlib.pyplot as plt | |
| array = np.array([[0, 0.1], [1, 1.1], [2, 1.8], [3, 2.7]]) | |
| print array | |
| X = array[:, 0:1] | |
| Y = array[:, 1] |
OlderNewer