数据分析不可不说的秘密
发布时间:2019-04-09 10:02来源: 未知
工欲善其事,必先利其器,想要进行数据分析,那分析工具必不可少,分析工具有很多,俗话说“人生苦短,我学python”。从今天起我会带大家一步一步入门python,学习基本的python知识。学习一门计算机语言,都是从变量及数据类型开始的。所以我们今天的重点就是变量和数据类型。
Python标准数据类型:Numbers数字,String字符串,List列表,Tuple元祖,Dict字典




接下来我们要认识变量
什么是变量? —— 方程式“=”左边的,就是变量
1、给变量赋值即创建该变量,并且同时赋予该变量
① 变量名
② 变量类型
等号(=)用来给变量赋值
2、变量命名规则:
① 变量名第一个字符必须是字母(大小写均可)或者下划线(“_”),不能数字开头;
② 变量名不能和常用功能性名字重合,例如print,if,for
③ 不要有空格

知道了变量,那么接下来就要了解运算符
什么是运算符?
1 +2 = 3 的例子中,1 和 2 被称为操作数,"+" 称为运算符

算数运算符

比较运算符

逻辑运算符

成员运算符
还有最后一个知识点-注释
注释是用来说明代码
程序运行的时候,Python解释器会直接忽略掉注释 → 有没有注释不影响程序的执行结果,但是影响到别人能不能看懂你的代码。
但“#”不只代表注释,还代表某些文件的特殊格式,写在脚本开头
注意:注释只在脚本中起作用