介绍

面向 R 用户的 Python

Daniel Chen

Instructor

基础知识

  • 变量
  • 赋值
  • 字符串
  • 列表
  • 字典
面向 R 用户的 Python

编程基础

  • 控制流(if 语句)
  • 循环
  • 函数
面向 R 用户的 Python

Pandas

  • 选择与子集
  • 数据类型
  • 数据处理与加工技术
面向 R 用户的 Python

绘图

  • pandas
  • matplotlib
  • seaborn
面向 R 用户的 Python

综合运用

  • 2013 年纽约航班数据集
  • 飞机
  • 航班延误
面向 R 用户的 Python

Python 数据类型

R
  • numeric:整数、浮点数
  • logicalTRUEFALSE
  • character:字符串
Python
  • int:整数
  • float:浮点数
  • boolTrueFalse
  • str:字符串
面向 R 用户的 Python

赋值

R
x <- 3

y = 0.5

z <- TRUE
Python
x = 3

y = 0.5

z = True
面向 R 用户的 Python

打印语句

R
print('R is awesome!')
"R is awesome!"
Python
print('Python too!')
Python too!
面向 R 用户的 Python

你的数据类型是什么?

R
x <- 3

class(x)
"numeric"
Python
x = 3

type(x)
int
y = 0.5

type(y)
float
面向 R 用户的 Python
R
1 + 1
2
'1' + '1'
Error in "1" + "1" : non-numeric argument to binary operator
'1' * 5
Error in "1" * 5 : non-numeric argument to binary operator
'1' '1'
Error: unexpected string constant in "'1' '1'"
面向 R 用户的 Python
Python
1 + 1
2
'1' + '1'
'11'
'1' * 5
'11111'
'1' '1'
'11'
面向 R 用户的 Python

让我们练习吧!

面向 R 用户的 Python

Preparing Video For Download...