예를 약속 같은데, 그것은 가능하다! rpy2를 사용하십시오.
당신과 RPY2를 설치할 수 있습니다 pip install rpy2
이
그런 다음 셀 중 하나에 %load_ext rpy2.ipython
를 실행합니다. (당신은 한 번만 실행해야합니다.)
는 이제 다음을 수행 할 수
파이썬 세포 :
# enables the %%R magic, not necessary if you've already done this
%load_ext rpy2.ipython
import pandas as pd
df = pd.DataFrame({
'cups_of_coffee': [0, 1, 2, 3, 4, 5, 6, 7, 8, 9],
'productivity': [2, 5, 6, 8, 9, 8, 0, 1, 0, -1]
})
R 세포 :
# import df from global environment
# make default figure size 5 by 5 inches with 200 dpi resolution
%%R -i df -w 5 -h 5 --units in -r 200
install.packages("ggplot2", repos='http://cran.us.r-project.org', quiet=TRUE)
library(ggplot2)
ggplot(df, aes(x=cups_of_coffee, y=productivity)) + geom_line()
을 그리고 당신은거야 python Pandas DataFrame에서 예쁜 그림을 그릴 수 있습니다.
출처
2017-01-27 08:50:56
uut
이것은 답변이 없으므로 귀하가 작업하는 프로젝트를 지원하는 것입니다. 당신이 링크하는 git repo를 보라. 적어도 "대신"진술이 가치가있는 이유를 설명하십시오. – mnky9800n