原创 Leetcode#34 Search for a Range

  題目描述:   Given an array of integers nums sorted in ascending order, find the starting and ending position of a given t

原创 Exercise:Pandas and Statsmodels

Part 1For each of the four datasets...Compute the mean and variance of both x and yCompute the correlation coefficient

原创 python編程從入門到實踐第六章習題

#6.1  人people = { "first_name" : 'zetrue' , "last_name": 'Lee' , "age": 20 , "city" : "汕尾" } print( people) for key in

原创 python編程從入門到實踐第十章習題

#10-1 文件讀取並輸出到屏幕 with open("learning_python.txt" , "r" ) as file: contents = file.read() print( contents )

原创 Exercise: scipy

練習題目與相應代碼如下:分析:使用最小二乘法:求出各個列向量線性組合後與b距離最小的線性組合#10.1 import numpy as np import scipy.optimize as opt #m > n m = 20 n =

原创 Exercise:Matplotlib入門

目的:    練習使用Matplotlib進行函數圖像的繪製等數據處理任務。題目:    一:實現函數圖像的繪製 import numpy as np import matplotlib.pyplot as plt #import sea

原创 LeetCode #46Trapping Rain Water

Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it

原创 Exercise: scikit-learn

Exercise:step1:    sklearn自帶生成數據集的函數from sklearn.datasets import make_classification datas = make_classification( n_sam

原创 python編程從入門到實踐第八章習題

#8-2 喜歡的圖書 def favorite_book( book ) : print( "One of my favorite books is " , book ) name = input( ) favorite_boo

原创 python編程從入門到實踐第五章習題

#5.2cars = [ 'bwm' , 'audi' , 'subaru' ] a_str = 'BWM' print( a_str == cars[0] ) print( a_str.lower()

原创 python編程從入門到實踐第三章習題答案

3.1-3.2names = ['zhichao' , 'yujie' , 'yifei'] for name in names: print( name.title() + " , good night.") 3.3trans

原创 python編程從入門到實踐第七章習題

#7-1 輸入輸出message = input( "What car do you want?") print( "Let me see if i can find you a ", message)#7-2 判斷是否有空桌number

原创 補:Leetcode#34 Search for a Range

題目描述:Given an array of integers nums sorted in ascending order, find the starting and ending position of a given target

原创 LeetCode #55jump game

'''#55jump gamesGiven an array of non-negative integers, you are initially positioned at the first index of the array.E

原创 LeetCode 11. Container With Most Water

題目要求:Given n non-negative integers a1, a2, ..., an, where each represents a point at coordinate (i, ai). n vertical lin