初學者須要IPython 與 Jupyter Notebook 嗎?

ipython 是 jupyter notebook的前身並擁有ipython的所有功能 javascript

       

jupyter擁有 cell, markdown 整合的功能, 能同時運行代碼, 並且是多組的. 同時也能夠插入markdown這種多功能註釋 包括圖片(但支持不好). html

寫教程,寫博客很是一流. 並且還能夠上傳到jupyterhub…聽說要本身搭建 java

       

對於初學者來講, jupyter畢竟是一個web應用, 存儲文件有不穩定的地方. 建議仍是使用pycharm這類的軟件編寫代碼. 若是是用於寫博客, sublime能夠安裝插件copy as html jupyter對於copy的優化不夠. 特別是離線圖片保存起來是不能夠顯示的. node

jupyter詳細教程 http://blog.csdn.net/tina_ttl/article/details/51031113 python

Python·Jupyter Notebook各類使用方法記錄·持續更新 git

標籤(空格分隔): Python github

Jupyter notebook )前身爲IPython Notebook,學習時,能夠找二者的教程 web

1、 Jupyter NoteBook的安裝 sql

1.1 新版本Anaconda自帶Jupyter shell

  • 目前,最新版本的Anaconda是自帶Jupyter NoteBook的,不須要再單獨安裝 

1.2 老版本Anacodna需本身安裝Jupyter

Jupyter Notebook安裝的官方網站

  • 安裝Jupyter Notebook先決條件:已經安裝了pythonpython 2.7 或者是python3.3
  •    

    具體的安裝方法:

    • 官方建議利用Anaconda安裝Jupyter
    • 安裝完成Anaconda後,若是該Anaconda並不自帶Jupyter Noterbook,那麼,打開cmd,輸入:conda install jupyter
  • 這樣安裝完的jupyter不具備New a terminal的功能 
    通過各類查詢才知道,原來是由於windows不具備terminal須要的TTY,因此,windows下的jupyter是不支持Terminal模式的,並且短時間內也沒有增長這種支持的計劃

    2、 更改Jupyter notebook的工做空間

    2.1 Jupyter的工做空間在哪裏指定?

    在其配置文件ipython_notebook_config.py中,有以下一句

    # The directory to use for notebooks and kernels.

    # c.NotebookApp.notebook_dir = u''

    • 1
    • 2
    • 3
    • 1
    • 2
    • 3

    該句就是用來指定其工做空間的,例如,默認的工做空間是:用戶名文件夾,例如,如今想要將工做空間變爲D:\Jupyter,那麼,須要作以下更改(要記得刪掉註釋#)

    # The directory to use for notebooks and kernels.

    c.NotebookApp.notebook_dir = u'D:\Jupyter'

    這句話很容易抄錯, ''前面是u ,還要去掉#, 並且你要在本地創建一個文件夾, 若是文件夾不存在也會出錯.

    • 1
    • 2
    • 3
    • 1
    • 2
    • 3

    注意:路徑最後一級後面不要加符號"\"

    2.2 如何找到該配置文件?

    參考目錄C:\Users\Administrator\.jupyter

    • cmd中輸入jupyter notebook --generate-config
    • 若是該配置文件已經存在,那麼,會出現以下信息,從中能夠見到配置文件存在的位置,注意,此時,輸入N,不要overwrite 
    • 若是該配置文件不存在,那麼,將會初始化產生一個配置文件

    cmd中輸入:ipython profile create 
    能夠找到關於jupyter的配置文件的位置

    3、Jupyter的各類快捷鍵

    • 執行當前cell,並自動跳到下一個cellShift Enter
    • 執行當前cell,執行後不自動調轉到下一個cellCtrl-Enter
    • 是當前的cell進入編輯模式:Enter
    • 退出當前cell的編輯模式:Esc
    • 刪除當前的cell:雙D
    • 爲當前的cell加入line number:單L
    • 將當前的cell轉化爲具備一級標題的maskdown:單1
    • 將當前的cell轉化爲具備二級標題的maskdown:單2
    • 將當前的cell轉化爲具備三級標題的maskdown:單3
    • 爲一行或者多行添加/取消註釋:Crtl /
    • 撤銷對某個cell的刪除:z
    • 瀏覽器的各個Tab之間切換:Crtl PgUpCrtl PgDn
    • 快速跳轉到首個cellCrtl Home
    • 快速跳轉到最後一個cellCrtl End

    4、Jupyter Notebook如何導入代碼

    即導入代碼到jupyter notebookcell

    4.1 將本地的.py文件loadjupyter的一個cell

    問題背景:有一個test.py文件,須要將其載入到jupyter的一個cell 
    test.py
    內容以下:

    import caffe

    SolverName = "/root/workspace"

    sovler = caffe.AdamSolver(SolverName)

    • 1
    • 2
    • 3
    • 1
    • 2
    • 3

    方法步驟 
    1)在須要導入該段代碼的cell中輸入

    %load test.py #test.py是當前路徑下的一個python文件

    • 1
    • 1

    2)運行該cell 
    利用快捷鍵"Shift+Enter",能夠看到以下結果: 

    3)能夠看到,運行後,%load test.py被自動加入了註釋符號#test.py中的全部代碼都被load到了當前的cell

    4.2 從網絡load代碼到jupyter

    • cell中輸入%load http://.....,而後運行該cell,就會將load後面所對應地址的代碼load到當前的cell中;
    • 下面給出一個例子,導入matplotlib中的一個小例子color example code
      •    

        首先,在想要導入該段代碼的cell中輸入

        %load test.py #test.py是當前路徑下的一個python文件

      •    

        1

      •    

        1

      • 而後,Shift+Enter運行,能夠看到以下結果: 

        能夠看到,運行後,%load test.py被自動加入了註釋符號#test.py中的全部代碼都被load到了當前的cell
    •    

      5、Jupyter運行python文件

      • 利用jupytercell是能夠運行python文件的,即在cell中運行以下代碼:

      %run file.py

      • 1
      • 1

      file.py爲要運行的python程序,結果會顯示在該cell 

      6、Jupyter一些其餘瑣碎用法

      6.1 jupytercell能夠做爲unix command使用

      具體方法爲:在unitx command前面加入一個感嘆號""

      例子: 
      查看python版本:
      !python --version 
      運行python文件:
      !python myfile.py

      6.2 Magic functions

      尚未太明白,具體細節見The cell magics in IPython

      6.3 獲取current working directory

      即當前運行的代碼所在的路徑 
      具體方法:
      current_path = %pwd 
      這樣獲得的current_path就是當前工做路徑的字符轉

      6.4 使用Matplotlib繪圖

      Jupyter Notebook中,若是使用Matplotlib繪圖,有時是彈不出圖像框的,此時,能夠在開頭加入

      %matplotlib inline

      • 1
      • 1

      7、Jupyter中的Markdown

      參考1 
      Markdown
      語法手冊 (完整整理版)參考

      7.1 jupyter中設置link,須要設置兩部分:

      • 要跳到的位置(the destination) 
        須要在要跳轉到的位置添加下面語句:

        <a id='the_destination'></a>

      • 1
      • 1

        這裏的id取值任意賦值,下面在添加連接時要用

      • 須要添加連接的文字(an internal hyperlink to the destination),即點擊該處能夠跳轉到the destination,在須要添加連接的文字後面加入:

        [須要添加鏈接的文字](#the_destination)

      • 1
      • 1
      • 下面是一個例子: 
        源碼: 

        效果圖: 

      7.2 Jupyter Notebook添加目錄功能

      • 原始的Jupyter是不支持markdown添加目錄功能的
      • 實際上,能夠利用Jupyter notebook extensions去使得這種功能實現
      •    

        具體方法: 

        • 利用Anaconda安裝Jupyter Notebook extensions 
          conda install -c conda-forge jupyter_contrib_nbextensions 
        • 打開Jupyter Notebook,在它的(新增的)Nbextensions標籤下勾選"Table of Contents(2)" 
        • 打開一個.jpynb文件,發現,目錄功能可用了! 

        參考文獻 
        [1] 
        Jupyter Notebook添加目錄

        14

        0

         

         

        猜你在找

        Jupyter Notebook27個祕訣,技巧和快捷鍵

        文摘供稿

        原文連接 
        翻譯:姜範波 
        校對:毛麗 && 寒小陽

        Jupyter Notebook

        Jupyther notebook ,也就是通常說的 Ipython notebook,是一個能夠把代碼、圖像、註釋、公式和做圖集於一處,從而實現可讀性分析的一種靈活的工具。 
        Jupyter
        延伸性很好,支持多種編程語言,能夠很輕鬆地安裝在我的電腦或者任何服務器上——只要有ssh或者http接入就能夠啦。最棒的一點是,它徹底免費哦。



        Jupyter
        界面 

        默認狀況下,Jupyter Notebook 使用Python內核,這就是爲何它原名 IPython NotebookJupyter notebookJupyter項目的產物——Jupyter這個名字是它要服務的三種語言的縮寫:JuliaPYThonR,這個名字與"木星(jupiter"諧音。本文將介紹27個輕鬆使用Jupyter的小竅門和技巧。

        1、快捷鍵

        高手們都知道,快捷鍵能夠節省不少時間。Jupyter在頂部菜單提供了一個快捷鍵列表:Help > Keyboard Shortcuts 。每次更新Jupyter的時候,必定要看看這個列表,由於不斷地有新的快捷鍵加進來。另一個方法是使用Cmd + Shift + P (  Linux Windows Ctrl + Shift + P亦可)調出命令面板。這個對話框可讓你經過名稱來運行任何命令——當你不知道某個操做的快捷鍵,或者那個操做沒有快捷鍵的時候尤爲有用。這個功能與蘋果電腦上的Spotlight搜索很像,一旦開始使用,你會欲罷不能。


         

        幾個個人最愛:

        • Esc + F 在代碼中查找、替換,忽略輸出。
        • Esc + O cell和輸出結果間切換。
        • 選擇多個cell: 
          • Shift + J  Shift + Down 選擇下一個cell
          • Shift + K  Shift + Up 選擇上一個cell
          • 一旦選定cell,能夠批量刪除/拷貝/剪切/粘貼/運行。當你須要移動notebook的一部分時這個頗有用。
        • Shift + M 合併cell. 

        2、變量的完美顯示

        有一點已經衆所周知。把變量名稱或沒有定義輸出結果的語句放在cell的最後一行,無需print語句,Jupyter也會顯示變量值。當使用Pandas DataFrames時這一點尤爲有用,由於輸出結果爲整齊的表格。 
        不爲人知的是,你能夠經過修改內核選項
        ast_note_interactivity,使得Jupyter對獨佔一行的全部變量或者語句都自動顯示,這樣你就能夠立刻看到多個語句的運行結果了。

  1. In [1]: from IPython.core.interactiveshell import InteractiveShell
  2. InteractiveShell.ast_node_interactivity = "all"
  3. In [2]: from pydataset import data
  4. quakes = data('quakes')
  5. quakes.head()
  6. quakes.tail()
  7. Out[2]:
  8. lat long depth mag stations
  9. 1 -20.42 181.62 562 4.8 41
  10. 2 -20.62 181.03 650 4.2 15
  11. 3 -26.00 184.10 42 5.4 43
  12. 4 -17.97 181.66 626 4.1 19
  13. 5 -20.42 181.96 649 4.0 11
  14. Out[2]:
  15. lat long depth mag stations
  16. 996 -25.93 179.54 470 4.4 22
  17. 997 -12.28 167.06 248 4.7 35
  18. 998 -20.13 184.20 244 4.5 34
  19. 999 -17.40 187.80 40 4.5 14
  20. 1000 -21.59 170.56 165 6.0 119

若是你想在各類情形下(NotebookConsoleJupyter都一樣處理,用下面的幾行簡單的命令建立文件~/.ipython/profile_default/ipython_config.py便可實現:

  1. c = get_config()
  2. # Run all nodes interactively
  3. c.InteractiveShell.ast_node_interactivity = "all"

3、輕鬆連接到文檔

Help 菜單下,你能夠找到常見庫的在線文檔連接,包括NumpyPandasScipyMatplotlib等。 
另外,在庫、方法或變量的前面打上?,便可打開相關語法的幫助文檔。

  1. In [3]: ?str.replace()

Docstring:

S.replace(old, new[, count]) -> str

     

Return a copy of S with all occurrences of substring

old replaced by new. If the optional argument count is

given, only the first count occurrences are replaced.

Type: method_descriptor

4 notebook裏做圖

notebook裏做圖,有多個選擇: 
matplotlib 
(事實標準),可經過%matplotlib inline 激活,詳細連接 
- %matplotlib notebook 
提供交互性操做,但可能會有點慢,由於響應是在服務器端完成的。 
mpld3 
提供matplotlib代碼的替代性呈現(經過d3),雖然不完整,但很好。 
bokeh 
生成可交互圖像的更好選擇。 
plot.ly 
能夠生成很是好的圖,惋惜是付費服務。


 

5 Jupyter Magic命令

上文提到的%matplotlib inline Jupyter Magic命令之一。 
推薦閱讀Jupyter magic命令的相關文檔,它必定會對你頗有幫助。下面是我最愛的幾個:

6 Jupyter Magic-%env:設置環境變量

沒必要重啓jupyter服務器進程,也能夠管理notebook的環境變量。有的庫(好比theano)使用環境變量來控制其行爲,%env是最方便的途徑。

In [55]: # Running %env without any arguments

# lists all environment variables

     

# The line below sets the environment

# variable OMP_NUM_THREADS

%env OMP_NUM_THREADS=4

env: OMP_NUM_THREADS=4

7Jupyter Magic - %run: 運行python代碼

%run 能夠運行.py格式的python代碼——這是衆所周知的。不那麼爲人知曉的事實是它也能夠運行其它的jupyter notebook文件,這一點頗有用。 
注意:使用%run 與導入一個python模塊是不一樣的。

In [56]: # this will execute and show the output from

# all code cells of the specified notebook

%run ./two-histograms.ipynb


 

8Jupyter Magic -%load:從外部腳本中插入代碼

該操做用外部腳本替換當前cell。可使用你的電腦中的一個文件做爲來源,也可使用URL

In [ ]: # Before Running

%load ./hello_world.py

In [61]: # After Running

# %load ./hello_world.py

if __name__ == "__main__":

print("Hello World!")

Hello World!

9Jupyter Magic - %store: notebook文件之間傳遞變量

%store 命令能夠在兩個notebook文件之間傳遞變量。

In [62]: data = 'this is the string I want to pass to different notebook'

%store data

del data # This has deleted the variable

Stored 'data' (str)

如今,在一個新的notebook文檔裏……

In [1]: %store -r data

print(data)

this is the string I want to pass to different notebook

10Jupyter Magic - %who: 列出全部的全局變量

不加任何參數, %who 命令能夠列出全部的全局變量。加上參數 str 將只列出字符串型的全局變量。

In [1]: one = "for the money"

two = "for the show"

three = "to get ready now go cat go"

%who str

one three two

11Jupyter Magic – 計時

有兩種用於計時的jupyter magic命令: %%time  %timeit.當你有一些很耗時的代碼,想要查清楚問題出在哪時,這兩個命令很是給力。 
仔細體會下個人描述哦。 
%%time 
會告訴你cell內代碼的單次運行時間信息。

In [4]: %%time

import time

for _ in range(1000):

time.sleep(0.01)# sleep for 0.01 seconds

CPU times: user 21.5 ms, sys: 14.8 ms, total: 36.3 ms

Wall time: 11.6 s

%%timeit 使用了Python timeit 模塊,該模塊運行某語句100000次(默認值),而後提供最快的3次的平均值做爲結果。

In [3]: import numpy

%timeit numpy.random.normal(size=100)

The slowest run took 7.29 times longer than the fastest. This could mean that an intermediate result is being cached.

100000 loops, best of 3: 5.5 µs per loop

12Jupyter Magic - %%writefile and %pycat:導出cell內容/顯示外部腳本的內容

使用%%writefile magic能夠保存cell的內容到外部文件。 %pycat功能相反,把外部文件語法高亮顯示(以彈出窗方式)。

In [7]: %%writefile pythoncode.py

     

import numpy

def append_if_not_exists(arr, x):

if x not in arr:

arr.append(x)

     

def some_useless_slow_function():

arr = list()

for i in range(10000):

x = numpy.random.randint(0, 10000)

append_if_not_exists(arr, x)

Writing pythoncode.py

In [8]: %pycat pythoncode.py

import numpy

def append_if_not_exists(arr, x):

if x not in arr:

arr.append(x)

     

def some_useless_slow_function():

arr = list()

for i in range(10000):

x = numpy.random.randint(0, 10000)

append_if_not_exists(arr, x)

13Jupyter Magic - %prun: 告訴你程序中每一個函數消耗的時間

使用%prun+函數聲明會給你一個按順序排列的表格,顯示每一個內部函數的耗時狀況,每次調用函數的耗時狀況,以及累計耗時。

In [47]: %prun some_useless_slow_function()

26324 function calls in 0.556 seconds

     

Ordered by: internal time

     

ncalls tottime percall cumtime percall filename:lineno(function)

10000 0.527 0.000 0.528 0.000 <ipython-input-46-b52343f1a2d5>:2(append_if_not_exists)

10000 0.022 0.000 0.022 0.000 {method 'randint' of 'mtrand.RandomState' objects}

1 0.006 0.006 0.556 0.556 <ipython-input-46-b52343f1a2d5>:6(some_useless_slow_function)

6320 0.001 0.000 0.001 0.000 {method 'append' of 'list' objects}

1 0.000 0.000 0.556 0.556 <string>:1(<module>)

1 0.000 0.000 0.556 0.556 {built-in method exec}

1 0.000 0.000 0.000 0.000 {method 'disable' of '_lsprof.Profiler' objects}

14Jupyter Magic –%pdb調試程序

Jupyter 有本身的調試界面The Python Debugger (pdb),使得進入函數內部檢查錯誤成爲可能。 
Pdb
中可以使用的命令見連接

In [ ]: %pdb

     

def pick_and_take():

picked = numpy.random.randint(0, 1000)

raise NotImplementedError()

     

pick_and_take()

Automatic pdb calling has been turned ON

---------------------------------------------------------------------------

NotImplementedError Traceback (most recent call last)

<ipython-input-24-0f6b26649b2e> in <module>()

5 raise NotImplementedError()

6

----> 7 pick_and_take()

     

<ipython-input-24-0f6b26649b2e> in pick_and_take()

3 def pick_and_take():

4 picked = numpy.random.randint(0, 1000)

----> 5 raise NotImplementedError()

6

7 pick_and_take()

     

NotImplementedError:

> <ipython-input-24-0f6b26649b2e>(5)pick_and_take()

3 def pick_and_take():

4 picked = numpy.random.randint(0, 1000)

----> 5 raise NotImplementedError()

6

7 pick_and_take()

     

ipdb>

15、末句函數不輸出

有時候不讓末句的函數輸出結果比較方便,好比在做圖的時候,此時,只需在該函數末尾加上一個分號便可。

In [4]: %matplotlib inline

from matplotlib import pyplot as plt

import numpy

x = numpy.linspace(0, 1, 1000)**1.5

In [5]: # Here you get the output of the function

plt.hist(x)

Out[5]:

(array([ 216., 126., 106., 95., 87., 81., 77., 73., 71., 68.]),

array([ 0. , 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1. ]),

<a list of 10 Patch objects>)

In [6]: # By adding a semicolon at the end, the output is suppressed.

plt.hist(x);

16、運行Shell命令

notebook內部運行shell命令很簡單,這樣你就能夠看到你的工做文件夾裏有哪些數據集。

In [7]: !ls *.csv

nba_2016.csv titanic.csv

pixar_movies.csv whitehouse_employees.csv

17、用LaTex 寫公式

當你在一個Markdown單元格里寫LaTex時,它將用MathJax呈現公式:如 
$$ P(A \mid B) = \frac{P(B \mid A) , P(A)}{P(B)} $$

會變成 

18、在notebook內用不一樣的內核運行代碼

若是你想要,其實能夠把不一樣內核的代碼結合到一個notebook裏運行。 
只需在每一個單元格的起始,用Jupyter magics調用kernal的名稱:

  • %%bash
  • %%HTML
  • %%python2
  • %%python3
  • %%ruby
  • %%perl
  • In [6]: %%bash
  • for i in {1..5}
  • do
  • echo "i is $i"
  • done

i is 1

i is 2

i is 3

i is 4

i is 5

19、給Jupyter安裝其餘的內核

Jupyter的優良性能之一是能夠運行不一樣語言的內核。下面以運行R內核爲例說明:

簡單的方法:經過Anaconda安裝R內核

conda install -c r r-essentials

稍微麻煩的方法:手動安裝R內核

若是你不是用Anaconda,過程會有點複雜,首先,你須要從CRAN安裝R 
以後,啓動R控制檯,運行下面的語句:

install.packages(c('repr', 'IRdisplay', 'crayon', 'pbdZMQ', 'devtools'))

devtools::install_github('IRkernel/IRkernel')

IRkernel::installspec() # to register the kernel in the current R installation

20、在同一個notebook裏運行RPython

要這麼作,最好的方法事安裝rpy2(須要一個能夠工做的R),用pip操做很簡單: 
pip install rpy2 
而後,就能夠同時使用兩種語言了,甚至變量也能夠在兩者之間公用:

In [1]: %load_ext rpy2.ipython

In [2]: %R require(ggplot2)

Out[2]: array([1], dtype=int32)

In [3]: import pandas as pd

df = pd.DataFrame({

'Letter': ['a', 'a', 'a', 'b', 'b', 'b', 'c', 'c', 'c'],

'X': [4, 3, 5, 2, 1, 7, 7, 5, 9],

'Y': [0, 4, 3, 6, 7, 10, 11, 9, 13],

'Z': [1, 2, 3, 1, 2, 3, 1, 2, 3]

})

In [4]: %%R -i df

ggplot(data = df) + geom_point(aes(x = X, y= Y, color = Letter, size = Z))


 

21、用其餘語言寫函數

有時候numpy的速度有點慢,我想寫一些更快的代碼。 
原則上,你能夠在動態庫裏編譯函數,用python來封裝… 
可是若是這個無聊的過程不用本身幹,豈不更好? 
你能夠在cythonfortran裏寫函數,而後在python代碼裏直接調用。 
首先,你要先安裝:

!pip install cython fortran-magic

     

     

In [ ]: %load_ext Cython

In [ ]: %%cython

def myltiply_by_2(float x):

return 2.0 * x

In [ ]: myltiply_by_2(23.)

我我的比較喜歡用Fortran,它在寫數值計算函數時十分方便。更多的細節在這裏

In [ ]: %load_ext fortranmagic

In [ ]: %%fortran

subroutine compute_fortran(x, y, z)

real, intent(in) :: x(:), y(:)

real, intent(out) :: z(size(x, 1))

     

z = sin(x + y)

     

end subroutine compute_fortran

In [ ]: compute_fortran([1, 2, 3], [4, 5, 6])

還有一些別的跳轉系統能夠加速python 代碼。更多的例子見連接

22、支持多指針

Jupyter支持多個指針同步編輯,相似Sublime Text編輯器。按下Alt鍵並拖拽鼠標便可實現。


 

23Jupyter外接拓展

Jupyter-contrib extensions是一些給予Jupyter更多更能的延伸程序,包括jupyter spell-checkercode-formatter之類
下面的命令安裝這些延伸程序,同時也安裝一個菜單形式的配置器,能夠從Jupyter的主屏幕瀏覽和激活延伸程序。

!pip install https://github.com/ipython-contrib/jupyter_contrib_nbextensions/tarball/master

!pip install jupyter_nbextensions_configurator

!jupyter contrib nbextension install --user

!jupyter nbextensions_configurator enable --user


24、從Jupyter notebook建立演示稿

Damian AvilaRISE容許你從已有的notebook建立一個powerpoint形式的演示稿。 
你能夠用conda來安裝RISE

conda install -c damianavila82 rise

或者用pip安裝:

pip install RISE

而後運行下面的代碼來安裝和激活延伸程序:

jupyter-nbextension install rise --py --sys-prefix

jupyter-nbextension enable rise --py --sys-prefix

25Jupyter輸出系統

Notebook自己以HTML的形式顯示,單元格輸出也能夠是HTML形式的,因此你能夠輸出任何東西:視頻/音頻/圖像。 
這個例子是瀏覽我全部的圖片,並顯示前五張圖的縮略圖。

In [12]: import os

from IPython.display import display, Image

names = [f for f in os.listdir('../images/ml_demonstrations/') if f.endswith('.png')]

for name in names[:5]:

display(Image('../images/ml_demonstrations/' + name, width=100))


 
 
 
 
 

咱們也能夠用bash命令建立一個相同的列表,由於magicsbash運行函數後返回的是python 變量:

In [10]: names = !ls ../images/ml_demonstrations/*.png

names[:5]

Out[10]: ['../images/ml_demonstrations/colah_embeddings.png',

'../images/ml_demonstrations/convnetjs.png',

'../images/ml_demonstrations/decision_tree.png',

'../images/ml_demonstrations/decision_tree_in_course.png',

'../images/ml_demonstrations/dream_mnist.png']

26、大數據分析

不少方案能夠解決查詢/處理大數據的問題:

  •  

       

    ipyparallel(以前叫 ipython cluster 是一個在python中進行簡單的map-reduce運算的良好選擇。咱們在rep中使用它來並行訓練不少機器學習模型。

  • spark-sql magic  %%sql

27、分享notebook

分享notebook最方便的方法是使用notebook文件(.ipynb),可是對那些不使用notebook的人,你還有這些選擇:

相關文章
相關標籤/搜索