- 博客(12)
- 收藏
- 关注
原创 emu193课程ipython的教程课后作业
Part1:import numpy as np import scipy as sp import pandas as pd import matplotlib.pyplot as plt import seaborn as sns import statsmodels.api as sm import statsmodels.formula.api as smf ...
2018-06-13 15:16:17
178
原创 Matplotlib习题
11.1import numpy as npimport matplotlib.pyplot as pltimport mathx = np.linspace(0, 2, 1000)y = [math.sin(i-2)**2 * math.exp(-i**2) for i in x]plt.plot(x, y)plt.xlabel('x')plt.ylabel('y')plt.t...
2018-05-30 14:42:13
447
原创 Numpy习题
元素生成:import numpy as npfrom scipy.linalg import toeplitzimport timemu,sigma = 0, 1.0n,m = 200, 500A = np.random.normal(loc = mu, scale = sigma, size = (n,m))C = [a for a in range(1, m + 1)]B =...
2018-05-21 21:30:38
214
原创 Leetcode 485 283 628
485:class Solution: def findMaxConsecutiveOnes(self, nums): """ :type nums: List[int] :rtype: int """ a = 0 b = 0 for i in nums: ...
2018-04-29 20:52:07
134
原创 《Python编程-从入门到实践》第十一章习题训练
11-1城市和国家:def city_function(city, country): r = city.title() + ', ' + country.title() return rimport unittestfrom city_functions import city_functionclass NameTestCase(unittest.TestCase):...
2018-04-15 20:00:10
239
原创 《Python编程-从入门到实践》第九章及第十章习题训练
9-1餐馆:class restaurant(): def __init__(self, name, type): self.name = name self.type = type def describe_restaurant(self): print(self.name + ' ' + self.type) def ...
2018-04-07 18:25:14
192
原创 《Python编程-从入门到实践》第七章及第八章习题训练
7-310的整数倍:num = int(input("Input a num:"))if (num % 10) == 0: print("yes")else: print("no")7-4披萨配料:a = Truewhile a != "quit": a = input("wut do you want?") if a != 'quit': p...
2018-03-31 20:42:23
225
原创 《Python编程-从入门到实践》第五章及第六章习题训练
5-1条件测试:pizza = 'cheese'print("Is pizza == 'cheese'? I predict True.")print(pizza == 'cheese')print("Is pizza == 'mushroom'? I predict False.")print(pizza == 'mushroom')5-2更多的条件测试:str1 = 'Happy's...
2018-03-25 13:27:08
386
原创 《Python编程-从入门到实践》第三章及第四章习题训练
3-1姓名:name = ["James", "Harden", "Steph", "Curry"]print(name[0].title() + " " + name[1].title() + " " + name[2].title() + " " + name[3].title() + " ")3-2问候语:name = ["Jame
2018-03-15 23:00:39
301
原创 《Python编程-从入门到实践》第二章习题训练
2-1简单消息:msg = "Hello world!"print(msg)2-2多条简单消息:msg = "Hello world"print(msg)msg = "This is Python"print(msg)2-3个性化消息:name = "Daniel"print("Hello " + name + ", how are you today?")2-4调整名字的大小写
2018-03-10 16:43:29
146
原创 初识Python的发现与收获
Python,是一种面向对象的解释型计算机程序设计语言,由荷兰人Guido van Rossum于1989年发明,第一个公开发行版发行于1991年。Python可以通过其官网www.python.org下载。目前,官网提供2.7.14与3.6.4两个不同版本的Python下载。在未来的一段时间中,Python 3.x将作为程序及开发的主流语言,因此,我也将选用Python 3.x作为我这段时间的学...
2018-03-10 15:56:48
1924
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人