python
字符串是 Python 中最常用的数据类型。我们可以使用引号('或")来创建字符串。
var1 = 'Hello World!'
var2 ='jun'
字符串相加
var=var1+var2
if语句
if 判断条件:
执行语句……
else:
执行语句……
多分支if语句
逻辑运算符
定义函数
def functionname( parameters ):
"函数_文档字符串"
function_suite
return [expression]
生成等差向量
np.arange([start, ]stop, [step, ]dtype=None)
nd1 = np.arange(5)#array([0, 1, 2, 3, 4])
nd2 = np.arange(1,5)#array([1, 2, 3, 4])
nd3 = np.arange(1,5,2)#nd3 = np.arange(1,5,2)
数字转字符串
str(x ) 将对象 x 转换为字符串
希腊字母
主要介绍采用Matplotlib模块画图时,横纵坐标或者标题如果要书写希腊字母,该如何处理这一问题
Matplotlib中支持LaTex语法,输入格式为:r'\(\Delta\)' #其中的Delta对应于希腊字母的Δ
r'$\Delta$rv' #对应于Δrv
The purview of science grows rapidly with time. It is the responsibility of each generation to join new insights to old wisdom, and to distill the key ideas for the next generation --James P. Sethna