Python output mathematical symbols example

I won't say much nonsense, everyone should just look at the code!

import pandas as pd
import numpy as np
import matplotlib.pyplot as plt

x=np.arange(10)
y=np.sin(x)

plt.figure(figsize=(10,8))

plt.plot(x,y,label=r'$\alpha_v$') #In two$Output between numbers
plt.title(r'$\alpha$')
plt.legend(fontsize=16)
plt.xlabel(r'$\theta_{se}$',fontsize=16) #Subscript use_To indicate that if there are multiple characters in the subscript or superscript, enclose it in curly braces
# plt.xlabel(r'$T$',fontsize=16) #Output italic T

Supplementary knowledge: python-calculate a simple mathematical expression in a paragraph of text

I won't talk too much nonsense, everyone should just look at the code

import re
 
txt="Please calculate the speed of the old driver within 2s
1678151565-1188787929+1755483937+817954137-442257056-2006451995*2113482706+790747088*888843907+1335150586-33099917=?;"
 
expression = re.search(r'(\d+[+\-*])+(\d+)', txt).group()
result =eval(expression)print(result)

The above example of python output mathematical symbols is all the content shared by the editor, I hope to give you a reference.

Recommended Posts

Python output mathematical symbols example
Python object-oriented example
Python3.7 debugging example method
Python interpolate interpolation example
How does Python output integers
How does python output backslashes
Python negative modulus operation example
Python3 logging log package example
Python regular expression example code
Python iterable object de-duplication example
Python one-dimensional two-dimensional interpolation example
Python draw bar graph (bar graph) example
Python string three formatted output
Python right alignment example method
Python regular expression learning small example
Python calculation of information entropy example
Python waterfall line indicator writing example
Python list comprehension operation example summary
Python ATM function implementation code example
Python decorator simple usage example summary
Example operation of python access Alipay
Python tcp transmission code example analysis
Python realizes console output color font
Python requests module session code example
Python verification code interception identification code example