はじめに

R ユーザーのための Python

Daniel Chen

Instructor

基本事項

  • 変数
  • 代入
  • 文字列
  • リスト
  • 辞書
R ユーザーのための Python

プログラミングの基礎

  • 制御フロー(if文)
  • ループ
  • 関数
R ユーザーのための Python

Pandas

  • データの選択とサブセット化
  • データ型
  • データ操作と処理
R ユーザーのための Python

グラフ描画

  • pandas
  • matplotlib
  • seaborn
R ユーザーのための Python

総まとめ

  • NYC Flights 2013データセット
  • 航空機
  • フライトの遅延
R ユーザーのための Python

Pythonのデータ型

R
  • numeric: 整数・浮動小数点数
  • logical: TRUE または FALSE
  • character: 文字列
Python
  • int: 整数
  • float: 浮動小数点数
  • bool: True または False
  • str: 文字列
R ユーザーのための Python

代入

R
x <- 3

y = 0.5

z <- TRUE
Python
x = 3

y = 0.5

z = True
R ユーザーのための Python

print文

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...