自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 《高级编程技术》作业[19]——python sklearn练习题

本周的作业是使用sklearn库来进行一些简单的机器学习练习。题目如下:接下来,我们按照题目中给出的步骤来一步步完成这个练习。1.创建一个样本量不小于1000,特征数不小于10的二元数据集。    因为要求的样本量比较大,所以我选择使用numpy.random.rand()函数来创建符合特定正态分布的样本特征,并分别把它们标记为0、1。    为了更好地检验之后机器学习算法得到的预测效果,在生成数...

2018-06-19 19:04:32 898

原创 《高级编程技术》作业[18]——python数据分析练习题

本次作业是emu193课程ipython的教程课后作业,原地址请见:https://nbviewer.jupyter.org/github/schmit/cme193-ipython-notebooks-lecture/blob/master/Exercises.ipynb一.IPython的使用ipython是一个很好用的网页python编辑、终端集成插件。使用它,可以很方便地进行代码的编写与运...

2018-06-09 21:11:41 2829

原创 《高级编程技术》作业[17]——Scipy练习题三道

本次作业是CME 193 Introduction to Python一书中关于Scipy库的练习部分,总共有三道题。第一题:    为了完成本题,我们需要:    1.使用numpy里面的random.normal来生成对应大小的随机矩阵。    2.使用np.linalg.lstsq来得到计算最小二乘余项。  代码如下:import numpy as npfrom scipy.linalg ...

2018-06-03 17:24:03 344

原创 《高级编程技术》作业[16]——Matplotlib练习题三道

本次作业是CME 193 Introduction to Python一书中关于Matplotlib库的练习部分,题目如下:为了简化表述,下面的说明中用np来指代numpy,用plt来指代matplotlib第一题:        为了完成本题,我们需要:    1.使用np.linspace来生成[0,2]区间任意数量的横轴坐标    2.使用np.sin和np.exp等函数来完成f(x)函数值...

2018-05-27 10:35:57 472

原创 《高级编程技术》作业[15]——Numpy练习题六道

本次作业是CME 193 Introduction to Python一书中关于Numpy库的练习部分。第一题:  为了完成本题,我们需要使用的Numpy或者Scipy函数有:   1.使用np.randorm.normal来生成具有高斯分布的A矩阵的元素。   2.使用np.zeros函数来生成指定大小的零矩阵。   3.使用scipy.linalg.toeplitz函数来生成拓普里兹矩阵B。 ...

2018-05-20 00:11:53 270

原创 《高级编程技术》作业[14]——LeetCode三道Array题目选做(4) : 79. Word Search

一.题目内容Given a 2D board and a word, find if the word exists in the grid.The word can be constructed from letters of sequentially adjacent cell, where "adjacent" cells are those horizontally or vertical...

2018-05-10 20:07:08 118

原创 《高级编程技术》作业[13]——LeetCode三道Array题目选做(3) : 35. Search Insert Position

一.题目内容Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in order.You may assume no duplicates in the arra...

2018-04-30 00:28:18 96

原创 《高级编程技术》作业[12]——LeetCode三道Array题目选做(2) : 66. Plus One

一.题目内容Given a non-empty array of digits representing a non-negative integer, plus one to the integer.The digits are stored such that the most significant digit is at the head of the list, and each ele...

2018-04-29 23:51:45 141

原创 《高级编程技术》作业[11]——LeetCode三道Array题目选做(1) : 64. Minimum Path Sum

一.题目原文Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right which minimizes the sum of all numbers along its path.Note: You can only move either down or right ...

2018-04-29 22:57:28 117

原创 《高级编程技术》作业[10]——第十章部分习题选做

输入文件:learning_python.txt如下:in python you can writein python you can seein python you can codein python you can't find yourself a girlfriend代码如下:#10-1filename = 'learning_python.txt'with open(fil...

2018-04-04 20:38:38 231

原创 《高级编程技术》作业[9]——第九章部分习题选做

#9-1class Restaurant(): def __init__(self, restaurant_name, cuisine_type): self.restaurant_name = restaurant_name self.cuisine_type = cuisine_type def describe_restaurant...

2018-04-04 19:49:29 153

原创 《高级编程技术》作业[8]——第八章部分习题选做

#8-4def make_shirt(size='big', word='default'): print("Make shirt: ") print("\tSize: " + size) print("\tWord: " + word)make_shirt('big', 'I love Python')make_shirt('big')make_shirt('m...

2018-03-28 21:21:22 214

原创 《高级编程技术》作业[7]——第七章部分习题选做

#7-1car = input("What brand of car do you want? -")print("Let me see if I can find you a " + car + '\n')#7-3num = input("Please input a number: ")if int(num) % 10 == 0: print("It's is an in...

2018-03-28 20:33:51 191

原创 《高级编程技术》作业[6]——第六章部分习题选做

#6-5rivers = { 'nile' : 'egypt', 'yellow' : 'china', 'zhu' : 'china'}for river, country in rivers.items(): print(river.title() + " is in " + country.title())for river in rivers.ke...

2018-03-21 21:01:49 375

原创 《高级编程技术》作业[5]——第五章部分习题选做

#5-7favorite_fruits = ['apple', 'banana', 'pinanapple', 'microsoft', 'orange']if 'apple' in favorite_fruits: print('You really like apple!')if 'Banana' in favorite_fruits: print("You really...

2018-03-19 18:35:03 192

原创 《高级编程技术》作业[4]——第四章部分习题选做

#4-1pizza_flavors = ['good', 'nice', 'black', 'white', 'big', 'small']for pizza_flavor in pizza_flavors: print('I like ' + pizza_flavor + ' pizza')print('I really love pizza!\n')#4-3show = "...

2018-03-14 21:12:12 156

原创 《高级编程技术》作业[3]——第三章部分习题选做

#3-4invited_person = ['mrs. white', 'mr. black', 'eric matthes']for person in invited_person: print('Welcome to my dinner, ' + person.title())print('\n')#3-5print('Oh no, ' + invited_person[...

2018-03-14 20:28:46 279

原创 《高级编程技术》作业[2]——第二章部分习题选做

#代码如下:#2-5print('Albert Einsteinonce said, "A person who never made a mistake never tried anything new."')#2-6first = 'albert'second = 'einstein'message = 'A person who never made a mistake neve...

2018-03-07 23:01:29 487

原创 《高级编程技术》作业[1]——python实现程序构想

    如果我成为了python编程的大佬,我希望使用这门语言拥有的众多优质的扩展库来实现我各种各样的需求。    譬如:    1.使用与游戏和图形相关的库,制作一款简单但有趣的游戏。虽然可能游戏的美工、音乐等方面可能会比较粗糙,但使用python做出来一个真正可玩甚至好玩的游戏是我目前的愿景之一。    2.使用与网页爬取相关的库,写一款实用软件,用来爬取学院官网通知、新闻,并把它们定时发送到...

2018-03-06 20:43:05 164

原创 《高级编程技术》作业[1]——python.org浏览发现与收获

    本周的第一项作业是对python.org进行浏览,并谈谈发现与收获。    虽然之前我也曾经浏览过Python的官网,但都只是为了在上面下载Python的最新发布而已。这次仔细地浏览了该网站之后,我有不少新的发现:    1.Python语言的更新发布与社区管理现在是由一个名为Python Software Foundation的非盈利组织在操作的,这个官网也同样是由它运作的。这一点和C+...

2018-03-06 20:30:34 147

空空如也

空空如也

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

TA关注的人

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