# r -> python

Post on 23-Aug-2014

1.039 views

Category:

## Science

Embed Size (px)

DESCRIPTION

Pandas, ggplot, scikit-learn, RDKitの話

TRANSCRIPT

• R -> Python Mishima.syk #3
• kzfm (@fmkz___) blog.kzfmix.com Shizuoka.py drumnbass Python6 Perl Flask, Pandas
• R
• Rstudio 1990-2010 UFO
• ggplot2 g + geom_point() + facet_wrap(~Species) + geom_smooth(method='lm')
• R
• Python
• R Python Pandas (DataFrame) ggplot (ggplotPython) scikit-learn (python)
• Pandas http://pandas.pydata.org/
• Pandas R http://www.slideshare.net/KazufumiOhkawa/1 2-20049278
• Series() >>> a = pd.Series(range(5), index=list(abcde)) # 0..5a..e >>> a[list(ace)] #index a 0 c 2 e 4 dtype: int64 >>> a[[0,2,4]] # 0,2,4 a 0 c 2 e 4 dtype: int64 >>> a[(a3)] #13 a 0 e 4 dtype: int64
• DataFrame >>> pd.DataFrame([[1,2,3],[4,5,6]]) 0 1 2 0 1 2 3 1 4 5 6
• DataFrame >>> x.index = list("ab") >>> x.columns = list("cde") >>> x c d e a 1 2 3 b 4 5 6
• DataFrame >>> x["c"] a 1 b 4 Name: c, dtype: int64 >>> x.c a 1 b 4 Name: c, dtype: int64
• >>> x.c.mean() # (1+4) / 2 2.5 >>> x.c.sum() # 1+4 5
• >>> x 0 1 0 1 0 1 -2 3 >>> pd.concat([x, x], axis=0) # rbind 0 1 0 1 0 1 -2 3 0 1 0 1 -2 3 >>> pd.concat([x, x], axis=1) # cbind 0 1 0 1 0 1 0 1 0 1 -2 3 -2 3
• Pandas R http://blog.kzfmix.com/entry/1387969720 http://blog.kzfmix.com/entry/1388051876 http://blog.kzfmix.com/entry/1388138505
• ggplot ggplotpython
• ()ggplot2 Photoshop ggplot2R
• ()IRIS
• g