微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

Python and R Reference in Data Analysis / Mining Tools

If you are already familiar with the module/package loading methods of Python and R, the following table is relatively easy to find.

Python is referenced in the following table as a module. Some modules are not native modules. Please use pip install * to install;

For the same reason, in order to facilitate indexing, R also refers to:: indicates the function and the name of the package where the function is located. If it does not contain :: indicates that it is in the default package of R, such as::, please use install.packages("*") to finish the installation.

Connector & IO

Database

 

类别PythonR
MysqL mysql-connector-python(官方) RMysqL
Oracle cx_Oracle ROracle
Redis redis rredis
MongoDB pymongo RMongo, rmongodb
neo4j py2neo RNeo4j
Cassandra cassandra-driver RJDBC
ODBC pyodbc RODBC
JDBC 未知[Jython Only] RJDBC

IO

类别PythonR
excel xlsxWriter, pandas.(from/to)_excel, openpyxl openxlsx::read.xlsx(2), xlsx::read.xlsx(2)
csv csv.writer read.csv(2), read.table
json json jsonlite
图片 PIL jpeg, png, tiff, bmp

Statistics

 

类别PythonR
描述性统计汇总 scipy.stats.descirbe summary
均值 scipy.stats.gmean(几何平均数), scipy.stats.hmean(调和平均数), numpy.mean, numpy.nanmean, pandas.Series.mean mean
中位数 numpy.median, numpy.nanmediam, pandas.Series.median median
众数 scipy.stats.mode, pandas.Series.mode 未知
分位数 numpy.percentile, numpy.nanpercentile, pandas.Series.quantile quantile
经验累积函数(ECDF) statsmodels.tools.ECDF ecdf
标准差 scipy.stats.std, scipy.stats.nanstd, numpy.std, pandas.Series.std sd
方差 numpy.var, pandas.Series.var var
变异系数 scipy.stats.variation 未知
协方差 numpy.cov, pandas.Series.cov cov
(Pearson)相关系数 scipy.stats.pearsonr, numpy.corrcoef, pandas.Series.corr cor
峰度 scipy.stats.kurtosis, pandas.Series.kurt e1071::kurtosis
偏度 scipy.stats.skew, pandas.Series.skew e1071::skewness
直方图 numpy.histogram, numpy.histogram2d, numpy.histogramdd 未知

Regression (including statistics and machine learning)

 

类别PythonR
普通最小二乘法回归(ols) statsmodels.ols, sklearn.linear_model.LinearRegression lm,
广义线性回归(gls) statsmodels.gls nlme::gls, MASS::gls
分位数回归(Quantile Regress) statsmodels.QuantReg quantreg::rq
岭回归 sklearn.linear_model.Ridge MASS::lm.ridge, ridge::linearRidge
LASSO sklearn.linear_model.Lasso lars::lars
最小角回归 sklearn.linear_modle.Lassolars lars::lars
稳健回归 statsmodels.RLM MASS::rlm

 

Hypothetical Test

 

类别PythonR
t检验 statsmodels.stats.ttest_ind, statsmodels.stats.ttost_ind, statsmodels.stats.ttost.paired; scipy.stats.ttest_1samp, scipy.stats.ttest_ind, scipy.stats.ttest_ind_from_stats, scipy.stats.ttest_rel t.test
ks检验(检验分布) scipy.stats.kstest, scipy.stats.kstest_2samp ks.test
wilcoxon(非参检验,差异检验) scipy.stats.wilcoxon, scipy.stats.mannwhitneyu wilcox.test
Shapiro-Wilk正态性检验 scipy.stats.shapiro shapiro.test
Pearson相关系数检验 scipy.stats.pearsonr cor.test

Time series

 

类别PythonR
AR statsmodels.ar_model.AR ar
ARIMA statsmodels.arima_model.arima arima
VAR statsmodels.var_model.var 未知

Mechine Learning

 

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。

相关推荐