自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(21)
  • 资源 (1)
  • 收藏
  • 关注

原创 sklearn exercises

2018-06-18 21:01:51 224

原创 jupyter exercise

2018-06-12 11:30:43 261

原创 scipy exercises

Exercise 10.1: Least squares Generate matrix A ∈ Rm×n with m > n. Also generate some vector b ∈ Rm. Now find x = argminxkAx−bk2. Print the norm of the residual.import numpy as np import scipy.optim...

2018-06-06 12:31:23 195

原创 matplotlib.pyplot 作业

Exercise 11.1from numpy import *import matplotlib.pyplot as pltx = linspace(0, 2, 200)y = power(sin(x - 2), 2) * exp(0-x*x)plt.plot(x, y, 'r-', label = '$x ^ 2$')plt.xlabel('x label')plt.ylabel...

2018-05-27 20:50:16 258

原创 Numpy Exercises

Generate matrices A, with random Gaussian entries, B, a Toeplitz matrix, where A ∈Rn×m and B ∈Rm×m, for n = 200, m = 500.Exercise 9.1: Matrix operations Calculate A + A, AA>,A>A and AB. Write a ...

2018-05-20 22:51:37 187

原创 T151 Reverse Words in a String

Given an input string, reverse the string word by word.Example:  Input: "the sky is blue",Output: "blue is sky the".Note:A word is defined as a sequence of non-space characters.Input string may cont...

2018-05-13 22:47:10 129

原创 String 5. Longest Palindromic Substring

Given a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000.Example 1:Input: "babad"Output: "bab"Note: "aba" is also a valid answer.Example 2:...

2018-05-02 12:13:45 388 1

原创 LeetCode 41.First Missing Positive

Given an unsorted integer array, find the smallest missing positive integer.Example 1:Input: [1,2,0]Output: 3Example 2:Input: [3,4,-1,1]Output: 2Example 3:Input: [7,8,9,11,12]Output: 1Note:Your ...

2018-04-27 14:03:02 98

原创 LeetCode Array 45 Jump Game II 解决方法

问题: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 at that position.Your goal is to ...

2018-04-24 13:48:37 97

原创 第十一章 动手试一试

11-1 城市和国家:编写一个函数,它接受两个形参:一个城市名和一个国家名。这 个函数返回一个格式为 City, Country 的字符串,如 Santiago, Chile。将这个函数存储 在一个名为 city _functions.py的模块中。 创建一个名为 test_cities.py的程序,对刚编写的函数进行测试(别忘了,你需要导 入模块 unittest 以及要测试的函数)。编写一个名...

2018-04-21 23:21:11 189

原创 第十章 动手试一试

10-1 Python 学习笔记:在文本编辑器中新建一个文件,写几句话来总结一下你至 此学到的 Python知识,其中每一行都以“In Python you can”打头。将这个文件命名为 learning_python.txt,并将其存储到为完成本章练习而编写的程序所在的目录中。编写一 个程序,它读取这个文件,并将你所写的内容打印三次:第一次打印时读取整个文件; 第二次打印时遍历文件对象;第三次...

2018-04-18 23:02:21 263

原创 第九章 动手试一试

9-4 就餐人数:在为完成练习 9-1 而编写的程序中,添加一个名为 number_served 的属性,并将其默认值设置为 0。根据这个类创建一个名为 restaurant 的实例;打印有 多少人在这家餐馆就餐过,然后修改这个值并再次打印它。class Restaurant(): def __init__(self, restaurant_name, cuisine_type): self...

2018-04-06 16:19:07 379

原创 第八章 动手试一试

8-2 喜欢的图书:编写一个名为 favorite_book()的函数,其中包含一个名为 title 的形参。这个函数打印一条消息,如 One of my favorite books is Alice in Wonderland。 调用这个函数,并将一本图书的名称作为实参传递给它。def favorite_book(title): print("One of my favorite book ...

2018-04-05 20:14:57 217

原创 第七章 动手试一试

7-1 汽车租赁:编写一个程序,询问用户要租赁什么样的汽车,并打印一条消息, 如“Let me see if I can find you a Subaru”。 7-2 餐馆订位:编写一个程序,询问用户有多少人用餐。如果超过 8人,就打印一 条消息,指出没有空桌;否则指出有空桌。print("What kind of car would you want?\n")print("Let me se...

2018-03-27 11:19:26 336

原创 第六章 动手试一试

6-1 人:使用一个字典来存储一个熟人的信息,包括名、姓、年龄和居住的城市。 该字典应包含键 first_name、last_name、age 和 city。将存储在该字典中的每项信息都 打印出来。friend = { 'first_name':'zeng', 'last_name':'huicong', 'age':'ten', 'city':'guangzhou', } for ...

2018-03-26 09:42:02 389

原创 第五章 动手试一试

5-1 条件测试:编写一系列条件测试;将每个测试以及你对其结果的预测和实际结 果都打印出来。5-2更多的条件测试:你并非只能创建10个测试。如果你想尝试做更多的比较,可再编写一些测试,并将它们加入到conditional_tests.py 中。对于下面列出的各种测试, 至少编写一个结果为 True 和 False 的测试。first_name = 'Chen'print("Is first_nam...

2018-03-26 00:16:01 613

原创 第四章 动手试一试

4-1 比萨:想出至少三种你喜欢的比萨,将其名称存储在一个列表中,再使用 for 循环将每种比萨的名称都打印出来。pizzas = ['海鲜比萨', '芝士比萨', '双拼比萨']for pizza in pizzas: print(pizza)for pizza in pizzas: print('我喜欢' + pizza)4-4 一百万:创建一个列表,其中包含数字 1~1 000 000,...

2018-03-20 11:32:04 549

原创 第三章 动手试一试

3-1 姓名:将一些朋友的姓名存储在一个列表中,并将其命名为 names。依次访问 该列表中的每个元素,从而将每个朋友的姓名都打印出来。names = ['小明', '小红', '小刚', '小李', '老张']for name in names: print('我有一个朋友叫' + name)3-4 嘉宾名单:如果你可以邀请任何人一起共进晚餐(无论是在世的还是故去的), 你会邀请哪些人?请创...

2018-03-14 20:41:33 393

原创 第二章 动手试一试

2-1 简单消息:将一条消息存储到变量中,再将其打印出来。message = "Zeng huicong is very good!!!"print(message)2-2 多条简单消息:将一条消息存储到变量中,将其打印出来;再将变量的值修改 为一条新消息,并将其打印出来。message = "Zeng huicong is very good!!!"print(message)messag...

2018-03-08 11:43:07 205

原创 今日畅想

    有很多人非常热衷唱歌,但是却没有得到上天的眷恋(五音不全),虽然自以为很好听,但实际上很是不堪。假如我是一个python高手,我首先会关心这种可怜的人。如果可以,我会创造一个只能麦克风,让他们的所唱和他们所想一样好听,这样听的人就可以像唱的人一样开心。        我并不知道这样东西的实现难度有多大,也不知道实用性有多好,只是说了自己的一个愿望而已。...

2018-03-07 12:32:10 200

原创 初识Python

    从别人口中我认识到的 Python 是一门高级编程语言,它有强大的函数和各种库,可用于数据分析、网站设计、机器学习和自然语言处理等。同时也因为它强大的功能和简洁的形式得到越来越多人的青睐。   然而我想分享的发现并不是这些技术性很强的东西,因为我自己的技术就突出。我想说的是Industrial Light & Magic (ILM)对Python 的成功使用,他们用 Python ...

2018-03-07 10:47:53 213

jupyter作业

使用jupyter进行简单的数据处理,求各种统计特性和模型拟合,以及数据可视化。

2018-06-12

空空如也

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

TA关注的人

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