- 博客(13)
- 收藏
- 关注
原创 高级编程技术,第十五周
作业题目如下:代码如下:1.库的引用from sklearn import datasets,cross_validationfrom sklearn.naive_bayes import GaussianNBfrom sklearn.svm import SVCfrom sklearn.ensemble import RandomForestClassifierfrom sklearn ...
2018-06-19 16:17:39 287
原创 高级编程技术,第十四周(补充了了第一题结果图和第二题代码修改)
%matplotlib inlineimport randomimport numpy as npimport scipy as spimport pandas as pdimport matplotlib.pyplot as pltimport seaborn as snsimport statsmodels.api as smimport statsmodels.form...
2018-06-11 00:59:01 262
原创 高级编程技术,第十三周
10.1# -*- coding: UTF-8 -*-import numpy as npimport scipy.optimize as optA = np.random.rand(20, 10)b = np.random.rand(20, 1)def err(p,A,b): x = p.reshape(10,1) #没有这一步拟合结果会有问题,因为leastsq传入的...
2018-06-02 19:53:58 189
原创 高级编程技术,第十二周(已修改第一题的错误)
11.1代码如下:import matplotlib.pyplot as pltimport numpy as npx = np.arange(0,2.0,0.01)y = (np.sin(x - 2) ** 2 ) * np.exp( - x ** 2 )plt.plot(x,y)plt.xlabel('X')plt.ylabel('Y')plt.title('11.1')pl...
2018-05-26 02:00:10 195
原创 高级编程技术,第十一周
Generate matrices A, with random Gaussian entries, B, a Toeplitz matrix, where A 2 Rn×m and B 2 Rm×m,for n = 200, m = 500 import numpy as npfrom scipy import linalgn = 200m = 500A = np.random.nor...
2018-05-22 16:56:19 131
原创 高级编程技术,第八周
leetcode #55 Jump Game题目链接:https://leetcode.com/problems/jump-game/description/题目描述:Given an array of non-negative integers, you are initially positioned at the first index of the array.Each element ...
2018-04-29 16:54:48 132
原创 高级编程技术,第六周
11.1 city.pydef get_city(city,country): return city.title() + ',' + country.title()test_city.pyimport unittestfrom city import get_cityclass CityTestCase(unittest.TestCase): def test_city(self):...
2018-04-15 17:58:44 105
原创 高级编程技术,第五周
9.1class Restaurant: def __init__(self,restaurant_name,cuisine_type): self.restaurant_name = restaurant_name self.cuisine_type = cuisine_type def describe_restaurant(self): print("...
2018-04-08 17:34:07 107
原创 高级编程技术,第四周
7-1name = input("Which car do you want to rent?:")print("Let me see if I can find you a " + name)7-2num = input("How many people are there?:")if int(num) > 8 : print("There is no free table!")e...
2018-04-01 18:49:40 138
原创 高级编程技术,第三周
5.2#coding=utf-8#仅选取原题中几个小问,避免代码段太长string = 'GGwp'print("Is string.lower() == 'ggwp'? I predict True.")print(string.lower() == 'ggwp')print("Is string.lower() == 'goodgame'? I predict False.")pr...
2018-03-25 14:52:10 109
原创 高级编程技术,第二周
3.1names = ['Mipha', 'Daruk', 'Revali', 'Urbosa', 'Link', 'Zelda']print(names[0])print(names[1])print(names[2])print(names[3])print(names[4])print(names[5])3.2names = ['Mipha', 'Daruk', 'Revali'...
2018-03-18 01:07:24 220
原创 高级编程技术,第一周
1.浏览python首页的收获:浏览python首页,可以很直观的看到python的各种特性以及python的广泛应用,尤其是python庞大的库,让我认识到了python与之前学过的C++,C的不同之处,这是一个十分方便的,利于解决各种问题的语言,同时python首页还提供各种python版本的下载和python新手的入门,十分的方便。2.成为python编程高手以后,你打算实现什么程序:pyt...
2018-03-05 22:28:01 595
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人