Python课程作业
文章平均质量分 54
hmpthz
这个作者很懒,什么都没留下…
展开
-
Python学习——第一周课程作业
虽然说是第一周作业,不过在此之前我就学习了一部分语法,不算零基础入门了,这周作业也没什么可细说的,随便写写初识Python Python最著名的特点莫过于简洁、易学习的语法和丰富的第三方库了。我也是通过Python官网提供的详细的文档学习相关语法的。小目标 打算主要研究爬虫,希望将来能用自己编写的工具从各大插画网站上抓取插画、漫画。如果以后会学习图像识别等方面的知识,也希望能结合起...原创 2018-03-11 21:21:24 · 655 阅读 · 0 评论 -
Python学习——matplotlib作业
Matplotlib ExercisesExercise 11.1: Plotting a functionPlot the function f(x)=sin2(x−2)e−x2f(x)=sin2(x−2)e−x2f(x) = sin^{2}(x-2)e^{-x^2} over the interval [0, 2]. Add proper axis labels, a titl...原创 2018-05-30 18:40:38 · 491 阅读 · 0 评论 -
Python学习——sklearn作业
Scikit-learn Assignment题目 In the second ML assignment you have to compare the performance of three di↵erent classification algorithms, namely Naive Bayes, SVM, and Random Forest. For this a...原创 2018-06-20 18:35:02 · 307 阅读 · 0 评论 -
Python学习——numpy作业
Numpy ExercisesGenerate matrices A, with random Gaussian entries, B, a Toeplitz matrix, where A 2 Rn×m and B 2 Rm×m,for n = 200, m = 500.import numpy as npfrom scipy.linalg import toeplitzn, m...原创 2018-05-23 17:40:12 · 754 阅读 · 0 评论 -
Python学习——Scipy作业
Scipy ExercisesExercise 10.1: Least squaresGenerate matrix A∈Rm∗nA∈Rm∗nA\in\mathbb{R}^{m*n} with m > n. Also generate some vector b∈Rmb∈Rmb\in\mathbb{R}^{m}. Now find x=argminx||Ax−b||2x=arg...原创 2018-06-02 21:26:46 · 579 阅读 · 0 评论 -
Leetcode题目分析:Median of Two Sorted Arrays
4. Median of Two Sorted Arrays题目There are two sorted arrays nums1 and nums2 of size m and n respectively. Find the median of the two sorted arrays. The overall run time complexity should be O(l...原创 2018-05-05 22:07:13 · 149 阅读 · 0 评论 -
Leetcode题目分析:Spiral Matrix
54. Spiral Matrix题目Given a matrix of m x n elements (m rows, n columns), return all elements of the matrix in spiral order.Example 1:Input:[ [ 1, 2, 3 ], [ 4, 5, 6 ], [ 7, 8, 9 ]]Output...原创 2018-05-01 19:38:45 · 133 阅读 · 0 评论 -
Python学习——第五周课程作业
9-3 用户 :创建一个名为User 的类,其中包含属性first_name 和last_name ,还有用户简介通常会存储的其他几个属性。在类User 中定义一个名为describe_user() 的方法,它打印用户信息摘要;再定义一个名为greet_user() 的方法,它向用户发出个性化的问候。 9-5 尝试登录次数 :在为完成练习9-3而编写的User 类中,添加一个名为login_at...原创 2018-05-01 14:51:16 · 1274 阅读 · 0 评论 -
Python学习——第四周课程作业
7-3 10的整数倍 :让用户输入一个数字,并指出这个数字是否是10的整数倍。num = int(input('please input number: '))if num % 10 == 0: print('It is a multiple of 10')else: print('It isn\'t a multiple of 10')7-9 五香烟熏牛肉(pas...原创 2018-05-01 14:50:37 · 2385 阅读 · 0 评论 -
Python学习——第三周课程作业
5-8 以特殊方式跟管理员打招呼 :创建一个至少包含5个用户名的列表,且其中一个用户名为’admin’ 。想象你要编写代码,在每位用户登录网站后都打印一条问候消息。遍历用户名列表,并向每位用户打印一条问候消息。如果用户名为’admin’ ,就打印一条特殊的问候消息,如“Hello admin, would you like to see a status report?”。否则,打印一条普...原创 2018-03-25 20:45:32 · 2025 阅读 · 0 评论 -
Python学习——第二周课程作业
3-4 嘉宾名单 :如果你可以邀请任何人一起共进晚餐(无论是在世的还是故去的),你会邀请哪些人?请创建一个列表,其中包含至少3个你想邀请的人;然后打印名单。>>> Kanmusu = ['DD IJN Ayanami', 'CL USS Cleveland', 'CA KMS Prinz Eugen', 'CV IJN Akagi', 'CV IJN Kaga']>...原创 2018-03-18 19:47:53 · 807 阅读 · 0 评论 -
Python学习——Anscombe’s quartet
Anscombe’s quartetAnscombe’s quartet comprises of four datasets, and is rather famous. Why? You’ll find out in this exercise.Part 1For each of the four datasets…Compute the mean and variance ...原创 2018-06-09 23:32:27 · 422 阅读 · 0 评论