- 博客(20)
- 资源 (4)
- 收藏
- 关注
原创 Sklearn 习题
题目: 基本内容为建立数据集,切割后分别使用三种算法进行训练并评估结果。from sklearn import datasets from sklearn import cross_validation from sklearn.naive_bayes import GaussianNB from sklearn.svm import SVC from sklearn.en...
2018-06-19 11:34:58 355
原创 pandas 习题
题目来源:https://nbviewer.jupyter.org/github/schmit/cme193-ipython-notebooks-lecture/blob/master/Exercises.ipynbAnscombe's quartetAnscombe's quartet comprises of four datasets, and is rather famous. Why? ...
2018-06-12 21:42:10 1426
原创 Scipy 习题
求解超定方程的最小二乘解,求解公式如下: import scipy.linalgimport numpy as npm=np.random.randint(20,30)n=np.random.randint(10,20)A=np.random.normal(0,1,[m,n])b=np.ran...
2018-06-05 19:26:16 398
原创 Matplotlib 习题
Exercise 11.1: Plotting a function Plot the function f(x) = sin2(x - 2)e-x2 over the interval [0; 2]. Add proper axis labels, a title, etc.import numpy as np import matplotlib.pyplot as plt...
2018-05-28 17:48:32 401
原创 Numpy 习题
Numpy 习题 import numpy as npfrom scipy.linalg import toeplitz Generate matrices A, with random Gaussianentries, B, a Toeplitz matrix, where A 2 Rn×m and B 2 Rm×m,for n = 200, m = 500n,m =200 ,500A = np...
2018-05-22 09:59:51 319
原创 answer for Leetcode problem 134
134. Odd Even Linked ListDescription:There are N gas stations along a circular route, where the amount of gas at station i is gas[i].You have a car with an unlimited gas tank and it costs cost[i] of g...
2018-05-13 19:31:31 149
原创 answer for Leetcode problem 120
328. TriangleDescription:Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below.For example, given the following triangle[ [2]...
2018-05-13 19:19:41 128
原创 answer for Leetcode problem 328
328. Odd Even Linked ListDescription:Given a singly linked list, group all odd nodes together followed by the even nodes. Please note here we are talking about the node number and not the value in the...
2018-04-30 22:20:12 136
原创 answer for LeetCode problem 287
287. Find the Duplicate NumberDescription:Given an array nums containing n + 1 integers where each integer is between 1 and n (inclusive), prove that at least one duplicate number must exist. Assume t...
2018-04-30 21:59:22 145
原创 some answers for chapter 11
11-1import unittestfrom city_functions import get_city_countryclassCityTestCase(unittest.TestCase): deftest_city_country(self): formatted_out= get_city_country("Santiago","Chile") sel...
2018-04-13 19:59:58 126
原创 some answers for chapter 10
10-2withopen('learning_python.txt') as file: for line in file: print(line.replace("python","C").rstrip())output:In C you can use varible,list,dictoinary andstructIn C you can use if and whil...
2018-04-08 19:48:43 116
原创 some answers for chapter 9
9-4classRestaurant(): def__init__(self, name, typ, number_served=0): self.restaurant_name =name self.cuisine_type = typ self.number_served = number_served defdescribe_restau...
2018-04-08 11:19:34 128
原创 some answer for chapter 8
8-2def favorite_message(title ): print("One of myfavorite books is "+title.title()+".")favorite_message("SophiesWorld")output:One of my favorite books is Sophies World.8-4def make_shirt(word = 'I l...
2018-03-31 21:24:19 117
原创 some answer for chapter 7
7-1message = input("Which cardo you want? ")print ("Let me seeif I can find you a "+ message +".")output:Which car do youwant? red carLet me see if I canfind you a red car.7-2message =int(input("How m...
2018-03-30 19:46:18 165
原创 some answer for chapter 6
6-1friend = {'first_name':'John','last_name':'Smith','age':'18','city':'New York'}for key,value insorted(friend.items()): print(key +":" ) print(" "+value)output:age: 18city: New Yorkfi...
2018-03-23 10:33:46 139
原创 some answer for chapter 5
5-2name = 'Lin'print("Is name =='Lin'? I predict True.")print(name =='Lin')print("\nIs name== 'Ling'?I predict False.")print(name =='Ling')print("\nIsname.lower() == 'lin'? I predict True.")print(name...
2018-03-20 20:14:34 136
原创 some answers for chapter 4
4-3for i inrange(1,21): print(i, end=' ')output:1 2 3 4 5 6 7 8 9 1011 12 13 14 15 16 17 18 19 20 4-5nums = range(1,1000000)print(min(nums))print(max(nums))print(sum(nums))output:199999949999950000...
2018-03-15 10:53:38 151
原创 some answers for chapter 3
3-2names = ['mike','john','jack']print("Hello,"+ names[0].title()+"!")print("Hello,"+ names[1].title()+"!")print("Hello,"+ names[2].title()+"!")output:Hello,Mike!Hello,John!Hello,Jack!3-4~ 3-7frie
2018-03-12 16:54:27 127
原创 answer for chapter 2
2-1message = "long time no see"print(message) output:long time no see2-2message = "long time no see"print(message)message = "yes"print(message) output:long time no seeyes2-3user = "lin"print("Hello "...
2018-03-11 10:24:55 118
原创 初探python官网,展望学成目标
首次浏览python官网,匆匆下载完软件资源就关闭了,未尝细看,再重新浏览,才发现上面有用的绝不仅仅只有下载的资源,更有许多值得一看的内容。 在初学者指引中可以找到python标准库的相关网页, 从中可以完整地了解到这门语言的基本内容,在学习一门语言中这是十分重要的。 在稍微找一下还能发现各种网络文档的链接,在需要查阅时,从官方给出文档中找是最好不过的了。 ...
2018-03-10 20:42:33 198
计算机网络自顶向下方法 第六版 答案 (英文完整版)
2019-04-12
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人