- 博客(15)
- 收藏
- 关注
原创 python作业——sklearn
exercises_sklearnCreate a classification dataset (n_samples >= 1000, n_features >= 10)Split the dataset using 10-fold cross validationTrain the algorithms GaussianNBSVC (possible C values ...
2018-06-19 16:32:19
340
原创 python作业——jupyter exercise
代码均在jupyter notebook上运行%matplotlib inlineimport randomimport numpy as npimport scipy as spimport pandas as pdimport matplotlib.pyplot as pltimport seaborn as snsimport statsmodels.api as sm...
2018-06-12 18:48:06
291
原创 python作业——scipy
Exercise 10.1: Least squaresdescription: solution:import numpy as npm = 20n = 10A = np.random.randint(10, 20, (m, n))b = np.random.randint(10, 20, (m, 1))x = np.linalg.lstsq(A, b, rcond=N...
2018-06-05 17:44:38
297
原创 python作业——Matplotlib
Exercise11.1description: code:import numpy as npimport matplotlib.pyplot as pltx = np. linspace (0, 2, 10000)y = (np.sin(x - 2) ** 2) * np.exp(-1 * (x**2))plt.xlim(0, 2)plt.ylim(0, 1)pl...
2018-05-27 11:07:10
493
原创 python作业——numpy
Generate matrices A, with random Gaussian entries, B, a Toeplitz matrix, where A ∈ R n×m and B ∈ R m×m , for n = 200, m = 500.Exercise 9.1: Matrix operations Calculate A + A, AA > , A > A an...
2018-05-21 23:49:37
246
原创 leetcode练习题(5)
402. Remove K Digitsdescription:Given a non-negative integer num represented as a string, remove k digits from the number so that the new number is the smallest possible.Example 1: Input: num = “1432
2018-05-06 20:45:21
129
原创 leetcode练习题(4)
376. Wiggle Subsequencedescription:A sequence of numbers is called a wiggle sequence if the differences between successive numbers strictly alternate between positive and negative. The first difference
2018-05-06 11:28:42
150
原创 leetcode练习题(3)
55. Jump GameDescription Given an array of non-negative integers, you are initially positioned at the first index of the array. Each element in the array represents your maximum jump length a
2018-05-03 19:45:40
148
原创 leetcode练习题(2)
39. Combination Sum Given a set of candidate numbers (candidates) (without duplicates) and a target number (target), find all unique combinations in candidates where the candidate numbers sums to tar
2018-04-30 17:46:29
151
原创 leetcode练习题(1)
15. 3Sumclass Solution(): def threeSum(self, nums): if len(nums) < 3: return [] nums.sort() answer = set() for i in range(0, len(nums)): if i
2018-04-30 13:16:57
290
原创 python作业 第四周
9-1class Restaurant(): def __init__(self, name, cuisine_type): self.name = name self.cuisine_type = cuisine_type def describe_restaurant(self): print('name:', self.name)
2018-04-08 21:19:26
242
原创 python作业 第三周
第五章#5-1for i in range(0, 10): print(i % 2 == 0)#5-2print('abcdef' == 'abcdef')print('abcdef' == 'bcdef')print('ABCDEF'.lower() == 'abcdef')print(1 >= 2)print(1 < 2)bool1 = 'AB...
2018-03-20 10:53:02
358
原创 python作业 第二周
第三章作业#3-1names = ['pp', 'ydm', 'wzy', 'cx']for name in names: print(name)#3-2for name in names: print(name, 'f**k you')#3-3transportation = ['automobile', 'subway', 'bicycle', 'foot']print
2018-03-14 20:09:26
397
原创 python从入门到实践课后习题 2-1到2-11
python从入门到实践课后习题 2-1到2-11直接贴出代码2-1 message = 'I wanna learn Python' print(message)2-2 message = 'I wanna learn Python' print(message) message = 'I wanna write Python'...
2018-03-08 11:40:44
545
原创 浏览python.org + 学会python之后自己想做的事情
一.浏览python.org的发现与感想首先,官网整体十分符合我的审美,排版简洁明了,突出重点,滚动窗口介绍了python的基本特点。1.官网Downloads栏目中提供了各种版本的python下载链接,包括各个更新版本的记录。2.Documentation中包含了从beginner到真正的developer的一系列教程。 浏览了一下stl,大致了解了一下python。 这
2018-03-08 11:23:25
250
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人