- 博客(20)
- 问答 (12)
- 收藏
- 关注
原创 第十五周,sklearn
Create a classification dataset (n samples ! 1000, n features ! 10) Split the dataset using 10-fold cross validation Train the algorithms GaussianNB SVC (possible C values [1e-02, 1e-0...
2018-06-18 11:45:53 308
原创 第十四周作业
作业取自https://nbviewer.jupyter.org/github/schmit/cme193-ipython-notebooks-lecture/blob/master/Exercises.ipynbPart 1For each of the four datasets...Compute the mean and variance of both x and yCompute th...
2018-06-10 22:14:02 528
原创 scipy作业
Exercise 10.1: Least squaresimport scipy.linalgimport numpy as npm = 20n = 10A = np.random.randint(0, 100, size=(m,n))x = np.random.randint(10, size=(n, 1))b = [list(np.random.normal(0, 1, 1)) ...
2018-06-04 20:17:18 301
原创 matplotlib作业
Exercise 11.1: Plotting a functionimport matplotlib.pyplot as pltfrom math import *import numpy as npdef function(x_list): return [pow(sin(x-2), 2) * exp(-1 * pow(x, 2)) for x in x_list]x ...
2018-05-28 16:35:13 439
原创 numpy作业
9.1,Matrix operations都是一些基本操作n = 200m = 500A = numpy.array([numpy.random.normal(0, 1, m) for _ in range(n)])B = scipy.linalg.toeplitz([1., -.25, *numpy.zeros(m-2)])# exercise 9.1print('\033[1;35...
2018-05-21 20:19:51 372
原创 leetcode #207
There are a total of n courses you have to take, labeled from 0 to n-1.Some courses may have prerequisites, for example to take course 0 you have to first take course 1, which is expressed as a pair: ...
2018-05-04 00:08:29 137
原创 leetcode #8
Pick OneImplement atoi which converts a string to an integer.The function first discards as many whitespace characters as necessary until the first non-whitespace character is found. Then, starting fr...
2018-05-01 21:28:05 122
原创 leetcode题两则
#16 3Sum ClosestGiven an array nums of n integers and an integer target, find three integers in nums such that the sum is closest to target. Return the sum of the three integers. You may assume that ...
2018-04-26 14:36:50 121
原创 11~1至11~3
11-1,城市和国家import unittestfrom city_functions import city_countryclass TestCase(unittest.TestCase): def test_format(self): formatname = city_country('Santiago', 'Chile') self.ass...
2018-04-13 11:36:22 416
原创 10-1至10-13
10-1,Python学习笔记file_name = 'text.txt'with open(file_name) as file_object: contents = file_object.read() print(contents)with open(file_name) as file_object: for line in file_object: ...
2018-04-05 18:13:48 223
原创 9-1至9-15
9-1,餐馆class Restaurant(): def __init__(self, name, type): self.restaurant_name = name self.cuisine_type = type def describe_resurant(self): print('restaurant_name: ' +...
2018-04-02 17:19:20 171
原创 8-1至8-17
8-1,消息def display_message(): print('I studied functions today.')display_m=essage()8-2,喜欢的图书def favorite_book(title): print('My favorite books is "' + title + '".')favorite_book("Alice in W...
2018-03-28 21:33:59 854
原创 7-1至7-10
7-1,汽车租赁car_name = input("Which car do you want to rend?")print('Let me see if I can find you a ' + car_name)7-3,10的整数倍number = input('Please input a number')if int(number) % 10 == 0: print(nu...
2018-03-27 17:14:00 579
原创 6-1至6-12
6-1,人people = {'first_name':'Wang', 'last_name':'Xiaoming', 'age':18, 'city':'Guangzhou'}for a, b in people.items(): print(a + ':' + str(b))6-5,河流rivers = {'Yangtse':'China', 'Ganges':'India', '...
2018-03-21 22:59:27 279
原创 5-1至5-13
5-5,外星人颜色#1alien_color = 'green'if alien_color == 'green': print('You get 5 points.')alien_color = 'yellow'if alien_color == 'green': print('You get 5 points.')5-5,外星人颜色#3alien_color = 'ye...
2018-03-19 16:53:19 179
原创 2-1至2-11
2-1,简单消息2-2,多条件简单消息2-3,个性化消息2-4,调整名字的大小写2-5,名言2-6,名言22-7,剔除人名的空白2-8,数字82-9,最喜欢的数字2-10,添加注释2-11,Python之禅...
2018-03-07 23:51:20 191
原创 如果我是python高手
图像识别软件 图像识别技术是目前比较火热的话题。身为python高手,我自然想要在其中插上一脚。图像识别技术应用广泛,而我比较感兴趣的是识别物体。1.图像识别之计数 一张图片上有多少个点?有多少个西瓜?有多少个人?诸如此类问题不一而足。而我要做的就是做...
2018-03-07 23:29:28 482
原创 python官网
python官网是我看过的比较简洁的官网之一。进入首页映入眼帘的首先是几个python代码的示例,用以表示python的一些特性。有趣的是,python官网几乎处处都表达了对初学者的善意和招揽。比如设置成功的故事一栏,叙述python所取得的成就;强调python是快的,友善的,易于学习的和开源的。并且它还特地说明有些人学了python后再也不想用其它工具。可谓吸引游客之余又彰显它的自信。...
2018-03-06 19:05:12 5261
空空如也
mongodb中如何限制数据库的大小
2021-05-24
没有默认构造的函数怎么传参
2017-05-29
c++写一个模板 Compare函数
2017-05-26
proteus中74ls194不会右移
2017-04-30
c++重载两个中括号[][]
2017-04-10
C语言,数学好的来看看%运算符
2016-11-06
C语言声明部分直接赋值是表达式语句吗
2016-11-06
C语言判断真假问题,求解释
2016-11-05
C语言调用函数时堆栈溢出问题
2016-11-01
C语言unsigned int问题
2016-11-01
c语言printf("%d", ++a + ++a);
2016-10-31
c语言unsigned int 可以和signed int 比较大小吗
2016-10-31
TA创建的收藏夹 TA关注的收藏夹
TA关注的人