在Jupyter笔记本中运行命令行代码

时间:2018-06-12 22:18:15

标签: jupyter-notebook

我正在使用Spark进行edX课程。它使用Jupyter笔记本。

我发现在笔记本中,有很多命令行代码可以下载和提取数据文件,如下所示

command="wget https://mas-dse-open.s3.amazonaws.com/Weather/by_state/%s -P %s 
"%(zip_file, weather_dir)

!$command
!ls -lh $weather_dir/$zip_file

#extracting the parquet file
!tar zxvf {weather_dir}/{zip_file} -C {weather_dir}

但是,当我在Jupyter笔记本中运行此单元时,这些命令都不起作用。 (我使用其他方法下载文件,例如,我安装并导入wget包并使用wget.download(url,out=directory)来实现相同的目标)。我觉得在Jupyter笔记本中可以直接调用这些命令行代码会很棒。我是否必须安装一些软件包才能使这个单元顺利运行?

0 个答案:

没有答案