- 博客(11)
- 收藏
- 关注
原创 sklearn作业
from sklearn import datasetsfrom sklearn import cross_validationfrom sklearn.naive_bayes import GaussianNBfrom sklearn.svm import SVCfrom sklearn.ensemble import RandomForestClassifierfrom sklea...
2018-07-18 11:55:41 162
原创 Scipy作业
10.1: import numpyimport scipy.linalgn = 3m = 3 A = numpy.random.rand(n, m)b = numpy.random.rand(m, 1)x, res , rk, s = scipy.linalg.lstsq(A, b) print(b)print(A.dot(x)) 10.2:import ...
2018-07-18 11:39:06 125
原创 Matplotlib作业
Exercise 11.1: import numpyimport matplotlib.pyplot as plt x = numpy.linspace(0, 2, 100) y = numpy.square(numpy.sin(x - 2)) * numpy.exp(-x * x) plt.plot(x, y)plt.title('f(x)')plt.xlabel(...
2018-07-18 10:20:14 199
原创 leetcode习题解
1.Two Sumclass Solution(object): def twoSum(self, nums, target): dic = {} for i, num in enumerate(nums): if num in dic: return [dic[num], i] else:...
2018-05-22 15:35:47 184
原创 书本第11章作业
11-1city_functions.py:def city_country(city,country): return city+', '+countrytest_cities.py:import unittestfrom city_functions import city_countryclass city_Test_class(unittest.TestCase): def t...
2018-05-22 15:26:31 194
原创 numpy作业
9.1import numpy as np import scipy.linalg as lp n = 200 m = 500 A = np.random.normal(size=(n,m)) B = lp.toeplitz(list(range(0,m))) print('A + A') print(A + A) print() print('AAT') prin...
2018-05-22 15:22:08 209
原创 第五周作业
9-1class Restaurant(): def __init__(self, name, cuisine): self.restaurant_name = name; self.cuisine_type = cuisine; def describe_restaurant(self): print(self.restaurant_name); print(self.cuisine_t...
2018-04-05 09:41:07 83
原创 第四周作业
7-1aa = input("What kind of cars do you want ")print('Let me see if I can find you a Subaru');7-2a = input('How many customers will have dinner?');if (a > 8): print('There are not enough table');el...
2018-04-01 22:03:24 115
原创 第三周作业
5-1a = 'abc';print(a == 'abc'); print(a != 'abc');print(a == 'ab'); print(a != 'ab');print(a == 'bc'); print(a != 'bc');print(a == 'ac'); print(a != 'ac');print(a == 'a'); print(a != 'a');5-2a = 'abc'...
2018-04-01 21:40:05 88
原创 第二周作业
3-1:names = ['lqd', 'lzl', 'ljh', 'tzj']print(names[0])print(names[1])print(names[2])print(names[3])3-2:names = ['lqd', 'lzl', 'ljh', 'tzj']print(names[0] + ", are you ok?")print(names[1] + ", are you...
2018-03-18 13:47:10 90
原创 第一周作业
1.浏览Python主页(https://www.python.org/),在博客上写下你有哪些发现和收获python主页提供了很多有用的信息,如python的简介,下载,文档,社区,成功故事,新闻等等。这是很好的学习平台,感觉完全可以自学。当然也不仅仅是一个学习平台,还可以了解python动态,信息量还是很大的。作为python新手,我觉得python主页是很好的导向,以后需要常上主页学习。不过...
2018-03-18 12:47:51 105
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人