2024年11月18日
摘要: 习题8.4 import numpy as np import pandas as pd import sympy as sp sp.init_printing(use_latex=True) from scipy.integrate import odeint import matplotlib. 阅读全文
posted @ 2024-11-18 12:51 犬塚米灵 阅读(2) 评论(0) 推荐(0) 编辑
摘要: 例7.3 import numpy as np import pylab as plt from scipy. interpolate import lagrange yx=lambda x: 1/(1+x**2) def fun(n): x=np.linspace(-5,5,n+1) p=lagr 阅读全文
posted @ 2024-11-18 12:36 犬塚米灵 阅读(2) 评论(0) 推荐(0) 编辑
  2024年10月27日
摘要: 例2.2.2 a=[] with open('data2_2.txt') as f: for (i, s) in enumerate(f): a.append([s.count('a'), s.count('c'), s. count('g'), s. count('t')]) b=np. arra 阅读全文
posted @ 2024-10-27 23:33 犬塚米灵 阅读(3) 评论(0) 推荐(0) 编辑
摘要: 习题3.2 import pandas as pd import sympy as sp sp.init_printing(use_unicode=True) import matplotlib.pyplot as plt plt.rcParams['font.sans-serif'] = ['Ti 阅读全文
posted @ 2024-10-27 23:32 犬塚米灵 阅读(0) 评论(0) 推荐(0) 编辑
摘要: 习题4.3 import numpy as np import pandas as pd import sympy as sp sp.init_printing(use_unicode=True) import matplotlib.pyplot as plt plt.rcParams['font. 阅读全文
posted @ 2024-10-27 23:32 犬塚米灵 阅读(2) 评论(0) 推荐(0) 编辑
摘要: 习题5.4 import cvxpy as cp import numpy as np import pandas as pd from scipy.optimize import minimize import sympy as sp sp.init_printing(use_unicode=Tr 阅读全文
posted @ 2024-10-27 23:32 犬塚米灵 阅读(1) 评论(0) 推荐(0) 编辑
摘要: 例题6.10 import networkx as nx L=[(1,2,20),(1,5,15),(2,3,20),(2,4,60),(2,5,25),(3,4,30),(3,5,18),(5,6,15)] G=nx.Graph();G.add_nodes_from(np.arange(1,7)) 阅读全文
posted @ 2024-10-27 23:32 犬塚米灵 阅读(5) 评论(0) 推荐(0) 编辑