Example #1
0
 def multiply(self, a, b):
     return ml(a, b)
Example #2
0
NameError: name 'urllib' is not defined
>>> f = urllib2.urlopen ("http://www.labs.forsk.in/")

>>> f.read(1000)
'<!DOCTYPE html>\r\n<html>\r\n<head>\r\n    <title>Forsk - Learn Code Today</title>\r\n\t<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">\r\n\t<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />\r\n    <link rel="shortcut icon" href="images/favicon.ico" type="image/x-icon">\r\n    <link href="css/bootstrap.css" rel=\'stylesheet\' type=\'text/css\' />\r\n    <script type="text/javascript" src="js/jquery-1.11.0.min.js"></script>\r\n<script src="js/bootstrap.min.js"></script>\r\n\t<script src="js/navcall.js"></script>\r\n    <link href="css/camera.css" rel="stylesheet" />\r\n    <link href="css/Reset.css" rel="stylesheet" type="text/css" />\r\n    <link href="css/style.css" rel="stylesheet" type="text/css" media="all" />\r\n    <link href="css/owl.carousel.css" rel="stylesheet" />\r\n\r\n    <script src="js/owl.carousel.js"></script>\r\n\r\n\t<script language="javascript">\r\n\tfunction send_message(){\r\n\tvar name = document.getElementById("name").value;\r\n\tvar '
>>> #useful for web-scraping
>>> 
>>> from datetime import date
>>> date.today()
datetime.date(2018, 2, 7)
>>> import math
>>> math.sqrt(16)
4.0
>>> from math import sqrt
>>> sqrt (6)
2.449489742783178
>>> from math import sqrt as ml
>>> ml(6)
2.449489742783178
>>> #IMPORTANT FILES
>>> 
>>> 
>>> import numpy

Traceback (most recent call last):
  File "<pyshell#72>", line 1, in <module>
    import numpy
ImportError: No module named numpy
>>> import pandas

Traceback (most recent call last):
Example #3
0
#!/usr/bin/env python
from common import *
from ml import *


if __name__ == "__main__":
    f = open("output.txt", "r")
    labels = []
    features = []
    for line in f:
        line = line.strip().split(tab)
        labels.append(line[0])
        features.append(line[1:])

    features = np.array(features)
    ML = ml(features, labels)
    print ml.getSVMClass(features[1])