随笔分类 - Python
摘要:1 import numpy as np 2 import matplotlib.pyplot as plt 3 import math 1 # Euler 2 def f(t,theta1,theta2): 3 return theta2 4 5 def g(t,theta1,theta2): 6
阅读全文
摘要:1 import numpy as np 2 import matplotlib.pyplot as plt 3 import math 4 5 from mpl_toolkits.mplot3d import Axes3D 6 7 xmin=-5 8 xmax=5 9 ymin=-5 10 yma
阅读全文
摘要:首先安装opencv:(在jupyter notebook里) 1 ! pip install opencv-python 接下来,从电脑的摄像头读取视频,识别视频内的人脸。 1 import cv2 2 3 face_cascade = cv2.CascadeClassifier('haarcas
阅读全文
摘要:1 # import packages 2 import matplotlib.pyplot as plt 3 import numpy as np 4 import time 5 from mpl_toolkits.mplot3d import Axes3D 6 from matplotlib i
阅读全文
摘要:1 import numpy as np 2 import matplotlib.pyplot as plt 3 4 filename = 'Unradiated_CG_Steel.txt' 5 f = np.genfromtxt(filename, delimiter=',') 6 X = f[:
阅读全文
摘要:Using Python to realize difference method. Here the data is from expermient. Use Central Difference method to solve the inner points, while forward di
阅读全文
摘要:1 import numpy as np 2 import matplotlib.pyplot as plt 3 from mpl_toolkits.mplot3d import Axes3D # used for 3d plot 4 5 x = np.linspace(0,100,50) 6 y
阅读全文
摘要:There are many commands that can load data into Python. Here I use genfromtxt and loadtxt as example. 1 import numpy as np 2 my_data = np.genfromtxt('
阅读全文
摘要:5 (x,y) data point: [1,2], [3,4], [5,6],[7,8]. Use Matplotlib to plot out these data points. 1 import matplotlib.pyplot as plt 2 figure1 = plt.plot( [
阅读全文
摘要:1- Create an empty list name “mylist” 1 mylist = [] 2 mylist # print mylist 2- Append the following floating point numbers to the list: 4.0, 2.2, 5.7,
阅读全文

浙公网安备 33010602011771号