我在Rstudio笔记本中运行一些python块,包括读取csv文件和打印基本统计信息。我找不到打印统计信息(describe())作为输出的方法。 这是代码:
```{python, engine.path = '/home/user/anaconda3/bin/python3'}
import pandas
data_py = pandas.read_csv('/home/user/datafiles/data.csv', sep= ';')
```
```{python, engine.path = '/home/user/anaconda3/bin/python3'}
data_py.describe(include='all')
```
没有打印输出。 我也尝试过:
```{python, engine.path = '/home/user/anaconda3/bin/python3'}
print(data_py.describe(include='all'))
```
和
```{python, engine.path = '/home/user/anaconda3/bin/python3'}
summary = data_py.describe(include='all')
print(summary)
```
没有成功。 有什么帮助吗?
答案 0 :(得分:0)
我遇到了同样的问题,如果你输入.Renviron文件,我发现你编写的代码有效:
PYTHONPATH = /家庭/亚历克斯/ anaconda2 / LIB / python2.7 /站点包/
更改站点包的路径(或包的位置)
{python} import pandas data_py = pandas.read_csv('data.csv', sep= ';') data_py.describe(include='all') summary = data_py.describe(include='all') print( summary)