自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 SYSU python作业 sklearn

题目要求:Create a classification dataset (n samples 1000, n features 10)2 Split the dataset using 10-fold cross validation3 Train the algorithmsI GaussianNBI SVC (possible C values [1e-02, 1e-01, 1e00, 1e...

2018-06-20 15:36:59 170

原创 SYSU python作业 Jupyter

原题目网址:https://nbviewer.jupyter.org/github/schmit/cme193-ipython-notebooks-lecture/blob/master/Exercises.ipynb第一题:For each of the four datasets...Compute the mean and variance of both x and yCompute th...

2018-06-13 16:15:10 204

原创 SYSU python作业 Scipy部分

import numpy import scipy.optimize as opt m=int(input()) n=int(input()) A = numpy.random.rand(m, n) b = numpy.random.random(m) res = opt.lsq_linear(A,b) norm = numpy.linalg.norm(b - numpy.dot(A, re...

2018-06-06 16:30:43 158

原创 SYSU Python作业 Matplotlib部分

import numpy import matplotlib.pyplot as plt x = numpy.linspace(0, 2, 20) y = numpy.power(numpy.sin(x-2), 2) * numpy.exp(-1*(x**2)) plt.plot(x, y, 'r-') plt.xlabel("x label") plt.ylabel("y label") plt...

2018-05-30 15:18:35 112

原创 SYSU python作业 exercise9

第一题import numpy from scipy.linalg import toeplitz import time def func1(A,B,_lambda): C = B - _lambda * (numpy.eye(m)) print("A*(B-λI) : ",numpy.dot(A, C)) def Matrix_operations(A,B): print("A+A : ...

2018-05-19 17:15:03 137

原创 SYSU python 代码作业4

给出 n 代表生成括号的对数,请你写出一个函数,使其能够生成所有可能的并且有效的括号组合。例如,给出 n = 3,生成结果为:[ "((()))", "(()())", "(())()", "()(())", "()()()" ]class Solution(object): def generateParenthesis(self, n): ans=[...

2018-05-06 11:13:16 125

原创 SYSU python 代码作业3

给定一个没有重复数字的序列,返回其所有可能的全排列。示例:输入: [1,2,3] 输出: [ [1,2,3], [1,3,2], [2,1,3], [2,3,1], [3,1,2], [3,2,1] ]思路:使用dfs搜索class Solution(object): def permute(self, nums): self.ans=[] ...

2018-05-06 11:04:35 285

原创 SYSU python 代码作业2

给定一个长度为 n 的整数数组 A 。假设 Bk 是数组 A 顺时针旋转 k 个位置后的数组,我们定义 A 的“旋转函数” F 为:F(k) = 0 * Bk[0] + 1 * Bk[1] + ... + (n-1) * Bk[n-1]。计算F(0), F(1), ..., F(n-1)中的最大值。注意:可以认为 n 的值小于 105。示例:A = [4, 3, 2, 6] F(0) = (0 ...

2018-04-29 14:54:46 377

原创 SYSU 代码作业1

leetcode 539给定一个 24 小时制(小时:分钟)的时间列表,找出列表中任意两个时间的最小时间差并已分钟数表示。示例 1:输入: ["23:59","00:00"] 输出: 1 备注:列表中时间数在 2~20000 之间。每个时间取值在 00:00~23:59 之间。class Solution(object): def findMinDifference(self, timeP...

2018-04-29 12:40:27 192

原创 SYSU python 作业

11.1 #test_cities.py import unittest from city_functions import func class test(unittest.TestCase): def test_city_country(self): cc=func("A","B") self.assertEqual(cc,"A,B") unittest.main() #ci...

2018-04-15 23:37:06 141

原创 SYSU Python第五周作业

#9.1 class Restaurant(): def __init__(self, restaurant_name,cuisine_type): self.restaurant_name=restaurant_name self.cuisine_type=cuisine_type def describe_restaurant(self): ...

2018-04-08 18:26:16 155

原创 SYSU Python 第四周作业

#7.1 car=input("Please input the car you want to rent: ") print("Let me see if I can find a",car,"for you") #7.2 num=int(input("Please input the num of guests: ")) if num>8: print("no") else: ..

2018-04-01 15:06:19 173

原创 SYSU Python 第三周作业

5-3 alien_color='green' if(alien_color=='green'): print('You have got 5 points') 5-4 alien_color='red' if(alien_color=='green'): print('You have got 5 points') else: print('You have got 1...

2018-03-25 19:08:04 156

原创 SYSU python 第二周作业

3.1-3.3names=['Lzy','Lyj','Lzc']for name in names:   print(name)   for name in names:   print(name+", good morning!")v=["Honda motorcycle","BMW car","Kawasaki motorcycle","Toyota car"]for i in v:   pr...

2018-03-14 20:22:33 258

原创 SYSU 第一周python作业

作业1:Python是一门简单且容易上手的语言,它是开源的,能用于各种商业场合。目前python的应用特别广泛,各种大公司例如youtube或者google的开发中大量使用python。它能简化编程,带来较高的效率。作业2:如果我熟练掌握python,我希望做的是一些网页的开发,甚至可以做一些网页游戏的后台。作业3:2.1-2.2message="Python homework"print(mes...

2018-03-10 22:40:30 128

原创 Test

TestHomework

2018-03-09 11:33:55 94

空空如也

空空如也

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

TA关注的人

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