自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

JHhhha的博客

博客名暗示了一切

  • 博客(18)
  • 收藏
  • 关注

原创 sklearn习题答案(仅供参考)

题目1、Create a classification dataset (n_samples >= 1000, n_features >= 10)(生成一个数据集,样本数大于等于1000,特征个数大于等于10)2、Split the dataset using 10-fold cross validation(将数据集分成10个集合)3、Train the algorithms (算法...

2018-06-20 20:19:42 1253

原创 Jupyter exercise答案(仅供参考)

本次练习的数据来源和教学 https://github.com/schmit/cme193-ipython-notebooks-lecture Part 1For each of the four datasets...Compute the mean and variance of both x and yCompute the correlation coefficient between x...

2018-06-11 15:40:26 328

原创 scipy习题答案(仅供参考)

Exercise 10.1: Least squaresGenerate matrix A ∈ Rm×n with m > n. Also generate some vector b ∈ Rm. Now find x = arg minx ∥Ax − b∥2.Print the norm of the residual.import numpy as npimport scipy as ...

2018-06-10 13:56:21 344

原创 matplotlib习题答案(仅供参考)

Exercise 11.1: Plotting a functionPlot the function    f(x) = sin2(x − 2)e−x2    over the interval [0, 2]. Add proper axis labels, a title, etc.import numpy as npimport matplotlib.pyplot as pltx = ...

2018-05-29 20:01:34 2095

原创 numpy习题答案(仅供参考)

Generate matrices A, with random Gaussian entries(高斯分布), B, a Toeplitz matrix(Toeplitz矩阵介绍), where A ∈ Rn×m and B ∈ Rm×m, for n = 200, m = 500.n = 200m = 500A = random.randn(n,m) #生成符合高斯分布的 n * m 矩...

2018-05-25 00:38:55 921

原创 Leetcode解题报告——238. Product of Array Except Self

Given an array of n integers where n > 1, nums, return an array output such that output[i] is equal to the product of all the elements of nums except nums[i].Solve it without division and in O(n).F...

2018-05-07 10:48:18 110

原创 Leetcode解题报告——540. Single Element in a Sorted Array

Given a sorted array consisting of only integers where every element appears twice except for one element which appears once. Find this single element that appears only once. Example 1:Input: [1, 1, 2...

2018-05-07 10:38:09 115

原创 Leetcode解题报告——215. Kth Largest Element in an Array

Find the kth largest element in an unsorted array. Note that it is the kth largest element in the sorted order, not the kth distinct element.Example 1:Input: [3, 2, 1, 5, 6, 4] and k = 2Output: 5Exam...

2018-05-07 10:28:30 96

原创 Leetcode解题报告——525. Contiguous Array

Given a binary array, find the maximum length of a contiguous subarray with equal number of 0 and 1. Example 1:Input: [0, 1]Output: 2Example 2:Input: [0, 1, 0]Output: 2Note: The length of the given ...

2018-05-07 10:21:18 112

原创 Python学习日志-8

今天分享的是第九章的要点和部分课后习题的参考代码。要点:1、类的创建和使用(class关键字和初始化函数__init__()).2、类的属性访问和方法调用.3、为属性提供默认值.4、继承类的定义以及如何将继承类与父类关联起来.5、给子类定义新属性和方法以及重写父类方法.6、类的导入.7、Python标准库中也有很多很好用的类.参考代码:9-1 class Restaurant(): def __...

2018-04-07 18:06:26 114

原创 Python学习日志-7

今天分享的是第八章的要点和部分课后习题的参考代码。要点:1、函数的定义与使用.2、位置实参和关键字实参.3、为参数提供默认值.4、有返回值的函数.5、可选实参的用法.6、用切片表示法[ : ]防止列表作为参数时被修改.7、传递任意数量的实参.8、模块与模块特点函数的导入.参考代码:8-1 def display_message(): print("We will learn how to use...

2018-04-07 14:16:55 138

原创 Python学习日志-6

今天分享的是第七章的要点和部分课后习题的参考代码。要点:1、input()的工作原理和使用.2、用int()来获取数值输入.3、求模运算符%.4、while循环的使用.5、break的使用.6、continue的使用.7、用while来处理列表和字典.参考代码:7-1 略7-2 略7-3  >>> number = input("Please input a number:")...

2018-04-04 20:40:19 121

原创 Python学习日志-5

今天分享的是第六章的要点和部分课后习题的参考代码。要点:1、字典的概念与使用.2、字典中添加键-值对.3、字典的修改.4、字典中删除键-值对.5、字典的遍历(item()返回键-值对的列表、keys()返回键的列表、values()返回值的列表).6、字典不关心排列顺序,只关心键和值的对应关系.7、通过sorted()实现按顺序遍历字典.8、字典和列表的相互嵌套.参考代码:6-1 user = {...

2018-04-04 18:52:15 146

原创 Python学习日志-4

今天分享的是第五章的要点和部分课后习题的参考代码。要点:1、逻辑判断符号和逻辑连词and和or.2、检查特定值是否(不)包含在列表中用(not in).3、if语句、if-else语句、if-elif-else结构、多个elif语句的使用、省略else代码块的用法.4、if语句处理列表.参考代码:5-1 略5-2 略5-3 #5-3alien_color = 'green'if alien_c...

2018-04-02 23:15:36 134

原创 Python学习日志-3

今天分享的是第四章的要点和部分课后习题的参考代码。要点:1、使用for遍历列表(别漏了冒号).2、避免缩进错误.3、range()的使用(range()具有三个参数).4、min()、max()、sum()分别用于找到数字列表的最小值、最大值和计算列表的和.5、列表解析:列表解析将for循环和创建新元素的代码合并成一行,并自动附加新元素.6、列表切片(参数正数和负数具有不同意义,正数表示从开头开始...

2018-04-02 23:15:08 93

原创 Python学习日志-2

今天分享的是第三章的要点和课后习题的参考代码。要点:1、列表的定义:列表由一些列按特定顺序排列的元素组成。在Python中,用方括号([])来表示列表,并用逗号来分隔其中的元素.2、列表元素的访问.3、索引从0而不是1开始.4、在列表中修改、添加和删除元素: append(item)在末尾添加元素、insert(location, item)在指定位置插入元素、del 删除特定元素、pop()删除...

2018-04-02 23:14:41 163

原创 Python学习日志-1

这是个记录我学习Python3心酸之路的日志,参考书目是《Python编程:从入门到实践》,我在sublime里配置Python3后就简单实用sublime打代码,今天分享的是第二章的要点和课后习题的参考代码。要点:1、print()的使用.2、变量命名规则.3、字符串的定义和使用.4、空白的添加和删除:\t、\n、rstrip()、lstrip()、strip().5、整数、浮点数的概念.6、s...

2018-03-10 22:37:45 182 1

原创 假如我是一个Python编程高手……

假如……假如我是个Python编程高手。哎,我自己都说不下去了,放过我好吧,我先乖乖把这学期的“外星人入侵”项目打完好吧

2018-03-10 21:56:16 142

空空如也

空空如也

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

TA关注的人

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