- 博客(13)
- 收藏
- 关注
原创 高级编程技术 hw week15
代码如下:from sklearn import datasets from sklearn import cross_validation from sklearn.naive_bayes import GaussianNB from sklearn.svm import SVC from sklearn.ensemble import RandomForestClassifier from...
2018-06-20 20:08:53 201
原创 高级编程技术hw week 14
%matplotlib inline import random import numpy as np import scipy as sp import pandas as pd import matplotlib.pyplot as plt import seaborn as sns import statsmodels.api as sm import statsmodels.form...
2018-06-12 09:24:46 181
原创 高级编程技术hw week 13
代码如下:import scipy as scipy import numpy as np from scipy import optimize #10.1 x=np.linspace(0.0,2.0,50) A=np.random.normal(size=(10,8)) b=np.random.normal(size=(10,1)) x=np.linalg.lstsq(A,b,None) pr...
2018-06-05 09:32:00 191
原创 高级编程技术hw week 12
代码如下:import matplotlib.pyplot as plt import numpy as np from scipy import stats #11.1 x=np.linspace(0.0,2.0,50) y=np.sin(x-2)*np.sin(x-2)*np.exp(-x**2) plt.figure(1) plt.xlabel("x") plt.ylabel("y") p...
2018-05-29 16:06:09 321
原创 高级编程技术hw week11
代码如下:import numpy as np import scipy from scipy import linalg import time import random def mul(m,n,row,mid,column): matrix=np.zeros((row,column)) for i in range(row): for j in range(column): ...
2018-05-22 19:46:07 2123
原创 高级编程技术hw week9
leetcode #67 Add Binary代码如下:class Solution: def addBinary(self, a, b): """ :type a: str :type b: str :rtype: str """ if len(a)<len(b): ...
2018-05-15 22:14:04 115
原创 高级编程技术hw week8
leetcode #11 Container With Most Water代码如下:class Solution: def maxArea(self, height): """ :type height: List[int] :rtype: int """ maxWater=0 i=0 ...
2018-04-25 13:50:11 134
原创 高级编程技术 hw week6
11-1:import unittest def city_function(city,country): return city.title()+', '+country.title() class TestCities(unittest.TestCase): def test_city_country(self): format_ans=city_fun...
2018-04-14 17:14:30 138
原创 高级编程技术 hw week5
#9-2 class Restaurant(): def __init__(self,restaurant_name,cuisine_type,number_served=0): self.restaurant_name=restaurant_name self.cuisine_type=cuisine_type self.number_se...
2018-04-09 01:11:30 138
原创 高级编程技术 hw week4
#7-2 num=input("How many people will come to dinner? ") if int(num)>8: print("Sorry, there isn't empty table big enough for you.") else: print("We can arrange an empty table for you.") prin...
2018-04-01 13:21:50 111
原创 高级编程技术 hw week3
#5-5 def judge(alien_color): if alien_color=='green': print('You have earned 5 points!') if alien_color=='yellow': print('You have earned 10 points!') if alien_color=='red'...
2018-03-25 13:36:10 266
原创 高级编程技术 hw week2
#3-2 names=['Nicole','Kelly','Peter'] for name in names: print('Hello, '+name.title()) print('') #3-7 names=['Steven Hawking','Cate Blanchett','Chris Hemsworth'] for name in names: print('Ple...
2018-03-15 23:29:39 147
原创 高级编程技术 hw week1
一、 在python主页上,有关于python语言的官方文档及教程,可以用于学习python以及今后在使用python时的参考资料查询。在网站中还有关于python包的资料,高效利用已有的包可以提高使用python的效率,python的功能强大,想必也有这些包的作用,可以不用重复造轮子,并为python本身之外提供了更加强大的功能。二、 我的目标是能够用python实现各种网络爬虫,可...
2018-03-11 13:38:07 188
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人