随笔分类 -  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 阅读全文
posted @ 2020-12-19 02:12 cfdchen 阅读(211) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2020-12-19 01:44 cfdchen 阅读(163) 评论(0) 推荐(0)
摘要:首先安装opencv:(在jupyter notebook里) 1 ! pip install opencv-python 接下来,从电脑的摄像头读取视频,识别视频内的人脸。 1 import cv2 2 3 face_cascade = cv2.CascadeClassifier('haarcas 阅读全文
posted @ 2020-10-20 08:31 cfdchen 阅读(915) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2020-10-20 07:25 cfdchen 阅读(153) 评论(0) 推荐(0)
摘要: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[: 阅读全文
posted @ 2020-10-20 07:13 cfdchen 阅读(156) 评论(0) 推荐(0)
摘要:Using Python to realize difference method. Here the data is from expermient. Use Central Difference method to solve the inner points, while forward di 阅读全文
posted @ 2020-10-02 05:08 cfdchen 阅读(386) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2020-09-26 09:35 cfdchen 阅读(2601) 评论(0) 推荐(0)
摘要: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(' 阅读全文
posted @ 2020-09-26 09:33 cfdchen 阅读(2237) 评论(0) 推荐(0)
摘要: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( [ 阅读全文
posted @ 2020-09-26 09:19 cfdchen 阅读(181) 评论(0) 推荐(0)
摘要: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, 阅读全文
posted @ 2020-09-26 09:09 cfdchen 阅读(271) 评论(0) 推荐(0)