自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(19)
  • 收藏
  • 关注

原创 高级编程技术第十九次作业

代码:from sklearn import datasets,cross_validation from sklearn.naive_bayes import GaussianNB from sklearn.svm import SVC from sklearn.ensemble import RandomForestClassifier from sklearn import metrics ...

2018-06-18 22:15:32 139

原创 高级编程技术第十八次作业

Anscombe's quartetAnscombe's quartet comprises of four datasets, and is rather famous. Why? You'll find out in this exercise.Part 1For each of the four datasets...Compute the mean and variance of both...

2018-06-11 21:58:29 140

原创 高级编程技术第十七次作业

Exercise 10.1: Least squaresGenerate matrix A 2 Rmn with m > n. Also generate some vector b 2 Rm.Now nd x = arg minx kAx .. bk2.Print the norm of the residual.代码:import numpy as np import scipy.lin...

2018-06-04 20:46:24 157

原创 高级编程技术第十六次作业

MatplotlibExercise 11.1: Plotting a functionPlot the functionf(x) = sin^2(x-2)e^-x2over the interval [0; 2]. Add proper axis labels, a title, etc.代码import numpy as np import matplotlib.pyplot as plt ...

2018-05-29 20:02:06 98

原创 高级编程技术第十五次作业

Generate matrices A, with random Gaussian entries, B, a Toeplitz matrix, where A 2 Rnm and B 2 Rmm, for n = 200, m = 500.9-1 Matrix operationsCalculate A + A, AA>, A>A and AB. Write a function t...

2018-05-21 22:37:13 217

原创 高级编程技术第十三次作业

55. Jump Game网址:https://leetcode.com/problems/jump-game/description/代码:class Solution: def canJump(self, nums): length = 0 for i in range(len(nums)): if length < i: return False if i...

2018-04-29 23:00:25 63

原创 高级编程技术第十三次作业

64. Minimum Path Sum网站:https://leetcode.com/problems/minimum-path-sum/description/代码:class Solution: def minPathSum(self, grid): row = len(grid) cow = len(grid[0]) _list = [[0]*cow]*row if ro...

2018-04-29 22:27:02 67

原创 高级编程技术第十二次作业

119. Pascal's Triangle II网址:https://leetcode.com/problems/pascals-triangle-ii/description/代码:class Solution: def getRow(self, rowIndex): _list = [1] if rowIndex == 0: return _list if rowInde...

2018-04-29 21:39:54 87

原创 高级编程技术第十一次作业

11-1 城市和国家city_functions.pydef city_country(city, country): return(city.title() + ", " + country.title())test_cities.pyimport unittest from city_functions import city_country class CitiesTestCas...

2018-04-15 22:15:27 96

原创 高级编程技术第十次作业

10-2 C语言学习笔记file_name = "learning_python.txt" with open(file_name) as file_object: lines = file_object.readlines() for line in lines: print(line.replace("Python", "C"))learning_python.txtIn Pytho...

2018-04-08 22:43:00 88

原创 高级编程技术第九次作业

9-1 餐馆class Restaurant(): """the restaurant""" def __init__(self, restaurant_name, cuisine_type): """Initialize the restaurant""" self.restaurant_name = restaurant_name self.cuisine_type

2018-04-08 22:07:48 89

原创 高级编程技术第八次作业

8-2 喜欢的图书def favourite_book(title): """print one of the favourite book""" print("One of my favourite book is " + title + '.') favourite_book('The three body problem')8-7 专辑def make_album(singer_name...

2018-04-01 16:38:35 118

原创 高级编程技术第七次作业

7-3 10的整数倍num = input("Please input a number: ") num = int(num) if num % 10 == 0: print('It is an integer multiple of 10') else: print('It is not an integer multiple of 10')7-6 三个出口prompt = '\nPleas...

2018-04-01 16:13:17 124 1

原创 高级编程技术第六次作业

6-5 河流rivers = { 'Yangtze River': 'China', 'Nile': 'Egypt', 'Amazonian River': 'Brazil', } for r, c in rivers.items(): print('The ' + r + ' runs through ' + c + '.') for r in rivers.keys(): prin...

2018-03-25 12:13:42 86

原创 高级编程技术第五次作业、

5-6 人生的不同阶段ages = [1, 2, 4, 13, 20, 65] for age in ages: if age < 2: print('He is a baby.') elif age < 4: print('He is learing to walk.') elif age < 13: print('He is a child.') elif...

2018-03-25 11:26:29 133

原创 高级编程技术第四次作业

4-1 比萨pizzas = ['fruit pizza', 'bacon pizza', 'seafood pizza'] for pizza in pizzas: print(pizza) for pizza in pizzas: print("I like " + pizza) print("I really love pizza!")4-7 3的倍数values = list(rang...

2018-03-18 11:46:55 114

原创 高级编程技术第三次作业

3-2 问候语names = ['jams', 'tom', 'john'] for name in names: message = name.title() + ', welcome to the python world!' print(message)3-4 嘉宾名单names = ['Kobe', 'Hawking', 'Einstein', 'Liu Cixin'] for nam...

2018-03-18 11:17:39 116

原创 高级编程技术第二次作业

2-1编写一条信息message = "hello world" print(message)2-2编写一条信息并修改message = "hello world" print(message) message = "hello python world" print(message)2-3输出一条含有名字的信息name = "Kessef" message = "Hello " + name +...

2018-03-10 17:45:32 144

原创 高级编程技术第一次作业

1、浏览ppython网页后的感想:在浏览过python的网页后最大的感想就是python比起之前所学的c++确实要简单不少。在python中有很多好用的库可以直接使用,这使得使用python写程序的时候可以代码变得很短,这也和python发明的初衷相同,就是使代码变得更加简洁和易懂。2、成为一个python高手后想做的事:在成为一个python高手后,我希望可以使用python来制作一个用于数据...

2018-03-10 17:20:18 158

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除