首页 > 其他分享 >习题2.12

习题2.12

时间:2024-10-22 12:58:27浏览次数:5  
标签:plt ve2 rcParams np import 习题 2.12

习题2.12代码

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.sans-serif']=['Times New Roman + SimSun + WFM Sans SC']
plt.rcParams['mathtext.fontset']='cm'

Times New Roman + SimSun + WFM Sans SC

simsum宋体, times new roman -*, simhei黑体, kaiti楷体,

dengxian等线, fangsong仿宋, Microsoft Yahei微软雅黑

plt.rcParams['axes.unicode_minus']=False
plt.rcParams['figure.dpi'] = 200

plt.rcParams['figure.figsize'] = [4, 3]

plt.rcParams['font.size'] = 12

plt.rcParams['xtick.direction'] = 'in'
plt.rcParams['ytick.direction'] = 'in'
A = np.array([[-1, 1, 0], [-4, 3, 0], [1, 0, 2]])
va1,ve1 = np.linalg.eig(A)
va1, ve1
A = sp.Matrix([[-1, 1, 0], [-4, 3, 0], [1, 0, 2]])
va2 = A.eigenvals()
ve2 = A.eigenvects()
va2, ve2
print(va2); print(ve2)

标签:plt,ve2,rcParams,np,import,习题,2.12
From: https://www.cnblogs.com/DENWOSHUABAZONGSHI/p/18492429

相关文章

  • 习题4.3
    习题4.3代码importcvxpyascpimportnumpyasnpimportmatplotlib.pyplotaspltplt.rcParams['font.sans-serif']=['TimesNewRoman+SimSun+WFMSansSC']plt.rcParams['mathtext.fontset']='stix'TimesNewRoman+SimS......
  • 习题5.7
    习题5.7代码importcvxpyimportcvxpyascpimportnumpyasnpimportpandasaspdfromscipy.optimizeimportminimizeimportsympyasspsp.init_printing(use_unicode=True)importmatplotlib.pyplotaspltx=cp.Variable(3,integer=True)cumulative_output=c......
  • 习题6.3
    习题6.3代码importnumpyasnpimportpandasaspdimportcvxpyascpimportnetworkxasnximportmatplotlib.pyplotaspltplt.rcParams['font.sans-serif']=['TimesNewRoman+SimSun+WFMSansSC']plt.rcParams['mathtext.fontset'......
  • 习题6.4
    习题6.4代码importnumpyasnpimportpandasaspdimportcvxpyascpimportnetworkxasnximportmatplotlib.pyplotaspltplt.rcParams['font.sans-serif']=['TimesNewRoman+SimSun+WFMSansSC']plt.rcParams['mathtext.fontset'......
  • 习题6.1
    习题6.1代码importnumpyasnpimportpandasaspdimportcvxpyascpimportnetworkxasnximportmatplotlib.pyplotaspltplt.rcParams['font.sans-serif']=['TimesNewRoman+SimSun+WFMSansSC']plt.rcParams['mathtext.fontset'......
  • python第五章课后习题
    importnumpyasnpimportmathfromscipy.optimizeimportminimize,Boundsdeffunc(x):returnsum(math.sqrt(x[i])foriinrange(100))defcon(x):return1000-np.sum(x[i]*(101-i+1)foriinrange(100))con1={'type':'ineq','fun&#......
  • 习题6.7代码
    习题6.7代码importnumpyasnpimportpandasaspdimportcvxpyascpimportnetworkxasnximportmatplotlib.pyplotaspltdf=pd.read_excel('F:\python数学建模与算法\源程序\《Python数学建模算法与应用》程序和数据\第6章图论模型\data6.xlsx')D=df.valuesdo......
  • 刷c语言练习题9(牛客网)
    1、12345678char*getmemory(void){    charp[]= "helloworld";    returnp;}voidtest(void){    char*str=NULL;    str=getmemory(); printf(str);}请问运行Test函数会有什么样的结果?A、出错B、输出"helloworld"C、输出空......
  • python第三章课后习题
    efX(n):#差分方程的解return2*(-1)**(n+1)n_values=[0,1,2,3,4,5]forninn_values:print(f"X({n})={X(n)}")print("学号:3028")importnetworkxasnxG=nx.DiGraph()foriinrange(1,7):G.add_node(i)edges=[(1,2),(1,4......
  • 选择结构程序设计之习题
    有3个整数a,b,c,由键盘输入,输出其中最大的数//有3个整数a,b,c,由键盘输入,输出其中最大的数#include<stdio.h>intmain(void){ inta,b,c; scanf("a=%db=%dc=%d",&a,&b,&c); if(a>b) { inttemp=a; a=b; b=temp; }//a<b if(a&g......