R和Python可以兼得嗎?

{"type":"doc","content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"italic"},{"type":"strong"}],"text":"本文最初發佈於towards data science網站,經原作者授權由InfoQ中文站翻譯並分享。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"R和Python有很多相似之處,也有很多不同之處。兩種語言的數據結構的大多數基礎概念都非常相似,並且現在這兩種語言都有許多數據科學包可用。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"但R的設計在我看來是“數據第一,應用第二”,而Python從一開始就給人感覺更多是應用程序開發驅動的。例如,純粹從語法和環境管理的角度來看,Javascript程序員上手Python的速度要比上手R的速度快一些。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"最近,我在工作中用到R和Python的次數越來越多,並且遇到了想要同時使用兩者的情況。出現這種情況的原因有很多,但最常見的一個場景是你正在用R構建某些東西,同時需要自己或其他人之前用Python編寫的功能。當然,你可以用R重寫它,但這不是很DRY嗎?"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"R中的reticulate這個包讓你可以在R會話中執行Python代碼。它實際上已經出來幾年了,並且一直在不斷改進,所以我想寫一個關於它具體用法的簡短教程。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"如果你是R的開發者,要啓動和運行reticulate需要你瞭解一些Python的運行機制—以及它管理環境的典型做法—所以本教程可以幫助你更快地完成設置,這樣就不用你自己去費勁研究了。"}]},{"type":"heading","attrs":{"align":null,"level":2},"content":[{"type":"text","text":"R和Python中的環境"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"任何編程項目都運行在一個環境中,它在這個環境裏存儲和訪問自己在執行過程中需要或創建的所有東西。在R中,所有項目都可以使用一個通用的全局環境,在這個環境裏可以訪問R基礎語言和所有已安裝的包。從這個意義上說,R中的所有項目通常都運行在相同的公共核心環境中。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"換一種方式來看待這個景象,你可以想象你家中所有成員的iPhone都共享同一個充電站;他們必須離開自己的房間給手機充電;如果他們出售自己的iPhone,買家需要自己解決充電問題。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"但在Python中,每個項目通常都設置爲完全自包含的—也就是說有自己的環境、自己的Python基礎副本和它需要執行的所有模塊的獨立副本。你可以把這種景象想象成每個人在他們的房間裏都有自己的iPhone充電器;他們不必走到外面找到統一的充電站來充電;如果他們出售手機,也會附上手機自己的充電器。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"Python的這種模式在安裝過程和磁盤\/內存資源消耗方面開銷更大,但它能讓開發者以最少的配置更輕鬆地在不同人之間轉移項目。不難看出,它是直接從軟件開發思維中發展出來的,這就是爲什麼我認爲Python更像是“應用程序驅動的”。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"這裏我應該提一下,對於這兩種語言的大多數日常用戶來說,我所描述的是“典型的”場景。這些模式不是完全不變的,而且如果你知道該怎麼做的話,在兩種語言中都可以使用兩種類型的項目流程。我們還看到R語言最近在朝着Python風格的環境管理模型邁進——例如renv包。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"下面是我畫的一個小草圖,它以簡單的方式展示R和Python中常見環境機制之間的區別。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"image","attrs":{"src":"https:\/\/static001.infoq.cn\/resource\/image\/01\/d7\/01311568feyy127cce32cb44dfdaf9d7.png","alt":null,"title":"","style":[{"key":"width","value":"75%"},{"key":"bordertype","value":"none"}],"href":"","fromPaste":false,"pastePass":false}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":"center","origin":null},"content":[{"type":"text","text":"R和Python中的典型環境工作流"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"現在,如果你想讓Python與R對話,前者仍然需要找到它自己的環境—你不能告訴它,讓它去訪問R的全局環境。這就像是讓一個只會說英語的美國人去找一個只會說中文的中國人問路。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"所以,要讓Python在你的R項目中跑起來,你需要做兩件事:"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"numberedlist","attrs":{"start":1,"normalizeStart":1},"content":[{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":1,"align":null,"origin":null},"content":[{"type":"text","text":"在R項目中設置一個Python環境,讓Python可以認出自己的路。"}]}]},{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":2,"align":null,"origin":null},"content":[{"type":"text","text":"用於翻譯Python代碼以使其在R中工作的reticulate包。"}]}]}]},{"type":"heading","attrs":{"align":null,"level":2},"content":[{"type":"text","text":"設置Python環境"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"從現在開始我會使用一個簡單的例子來做說明。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"假設我在RStudio中有一個R項目,它需要使用我用Python編寫的函數。所以這裏有一個簡單的函數,我將它保存在我的R項目目錄test_python中的一個名爲light_years.py的Python腳本中(是的,RStudio允許你創建Python腳本!)。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"這個函數接收公里或英里爲單位的距離作爲輸入,並計算以光速行進這段距離需要多少年。換句話說,以光年爲單位的距離是多少。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"codeblock","attrs":{"lang":"plain"},"content":[{"type":"text","text":"from scipy.constants import cdef light_years(dist, unit = \"km\"):\n \n c_per_year = c * 60 * 60 * 24 * 365.25\n \n if unit == \"km\":\n \n dist_meters = dist * 1000\n \n elif unit == \"mi\":\n \n dist_meters = dist * 1.60934 * 1000\n \n else:\n \n sys.exit(\"Cannot use that unit!\")\n \n \n return dist_meters\/c_per_year\n"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"我在這裏使用了一個非常簡單的函數示例,以免讓這篇文章太過冗長。所以它有點不切實際,也有點蠢,因爲我導入整個scipy包只是爲了獲取一個常量的值,但希望它能幫助你領會我的意思。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"現在正像我們上面所討論的,我們需要爲這段代碼提供一個環境。它需要:"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"numberedlist","attrs":{"start":1,"normalizeStart":1},"content":[{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":1,"align":null,"origin":null},"content":[{"type":"text","text":"要使用的Python版本"}]}]},{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":2,"align":null,"origin":null},"content":[{"type":"text","text":"訪問scipy包,從而可以獲得常數c=光速"}]}]}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"爲你的R項目設置一個Python環境並不難。鑑於項目環境在Python中的重要性,市面上存在許多易用的環境管理工具。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"我最喜歡的是Anaconda。它有兩個版本可用。完整版包含環境可能需要的所有一大堆東西,包括所有最常用的Python模塊。然後是Miniconda,它佔用的磁盤空間少很多,更適合條件有限的Python用戶。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"你可以在"},{"type":"link","attrs":{"href":"https:\/\/docs.conda.io\/en\/latest\/miniconda.html","title":"","type":null},"content":[{"type":"text","text":"此處"}]},{"type":"text","text":":"},{"type":"link","attrs":{"href":"https:\/\/docs.conda.io\/en\/latest\/miniconda.html","title":"","type":null},"content":[{"type":"text","text":"https:\/\/docs.conda.io\/en\/latest\/miniconda.html"}]},{"type":"text","text":"獲取適用於你操作系統的Miniconda。請爲要使用的Python版本下載對應的Conda。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"安裝完Conda後,如果你使用的是macOS或Linux,通常會使用命令行來設置環境。只需轉到終端中你的R項目目錄(在我的例子中是test_python)並使用以下命令:"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"codeblock","attrs":{"lang":"plain"},"content":[{"type":"text","text":"conda create --name test_python\n"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"就這麼簡單,你現在已經創建了一個python環境。我通常將我的環境命名爲與項目文件夾相同的名稱,以免將來混淆。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"現在你需要告訴Conda,讓它爲這個項目使用這個環境。當你仍在命令行的test_python目錄中時,使用以下命令:"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"codeblock","attrs":{"lang":"plain"},"content":[{"type":"text","text":"conda activate test_python\n"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"現在你已將此項目鏈接到了Python環境,並且其中有Python基礎的一個副本供你的代碼運行使用。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"最後,我們的函數需要scipy包,所以我們需要把它放在環境中。只需在激活的項目文件夾中輸入以下內容即可:"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"codeblock","attrs":{"lang":"plain"},"content":[{"type":"text","text":"conda install scipy\n"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"然後,Conda會將scipy及它認爲可能需要的所有依賴項安裝到你的活動環境中,你就可以開始使用了——可以這麼說,就像scipy一樣簡單。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"稍後你需要告訴R,在這個環境中在哪裏可以找到Python。用這條命令可以獲得所有環境的列表以及安裝環境的路徑:"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"codeblock","attrs":{"lang":"plain"},"content":[{"type":"text","text":"conda info --envs\n"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"例如,這能告訴我,我的環境安裝在\/Users\/keithmcnulty\/opt\/miniconda3\/envs\/test_python。我總能在bin子目錄中找到Python可執行文件——所以我的項目的Python可執行文件的完整路徑是\/Users\/keithmcnulty\/opt\/miniconda3\/envs\/test_python\/bin\/python3,因爲我使用的是Python 3。我們需要告訴R的就是這些,這樣它就知道在哪裏可以找到Python環境了。"}]},{"type":"heading","attrs":{"align":null,"level":2},"content":[{"type":"text","text":"在R中運行你的Python函數"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"現在,無論你是像我一樣用Conda設置了Python環境,還是使用了virtualenv,你都已經完成了最艱鉅的部分。剩下的操作很簡單,因爲reticulate會接手。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"首先,當R加載項目時,你需要告訴R,在正確的環境中在哪裏可以找到Python可執行文件。爲此,請啓動一個空文本文件並添加以下內容,將我的路徑替換爲與你創建的項目環境中的Python可執行文件匹配的路徑。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"codeblock","attrs":{"lang":"plain"},"content":[{"type":"text","text":"Sys.setenv(RETICULATE_PYTHON = \"\/Users\/keithmcnulty\/opt\/miniconda3\/envs\/test_python\/bin\/python3\")\n"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"現在將這個文本文件保存在你的項目目錄中,名稱爲.Renv。這是一個隱藏文件,每當你在RStudio中啓動項目時,R都會執行該文件。所以現在關閉RStudio並在打開test_python項目的同時重新啓動它,它現在將指向Python環境。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"如果你還沒有安裝reticulate R包,你應該在這個時候安裝。安裝後,你可以在終端中嘗試一些測試,看看是否一切正常。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"首先,你可以測試R是否知道Python在哪裏。reticulate::py_available()應該返回“TRUE”。你還可以測試項目是否安裝了你需要的Python模塊:reticulate::py_module_available(\"scipy\")應返回“TRUE”。假設一切正常,你已準備好將你的函數引入R了。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"你可以使用簡單的一條命令來獲取Python腳本:"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"codeblock","attrs":{"lang":"plain"},"content":[{"type":"text","text":"reticulate::source_python(\"light_years.py\")\n"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"現在你可以將light_years()函數用作R函數。讓我們看看以光速行駛一千萬英里需要多少年:"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"codeblock","attrs":{"lang":"plain"},"content":[{"type":"text","text":"> light_years(1000000000000000, \"mi\")\n[1] 170.1074\n"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"很好!顯然,這是一個非常簡單的示例,但它確實告訴了你關於如何將Python代碼集成到R腳本中的所有信息。你現在可以自由引入目前僅支持Python的各種功能或包,並讓它們在R中工作,這非常令人興奮。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"如果你想查看一些高級示例,進一步瞭解如何使用reticulate將Python和R結合在一起使用,請查看我最近的幾篇文章:"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"link","attrs":{"href":"https:\/\/towardsdatascience.com\/five-ways-to-work-seamlessly-between-r-and-python-in-the-same-project-bf173e35fdef","title":"","type":null},"content":[{"type":"text","text":"在同一項目中無縫切換R和Python的五種方法"}]},{"type":"text","text":":"},{"type":"link","attrs":{"href":"https:\/\/towardsdatascience.com\/five-ways-to-work-seamlessly-between-r-and-python-in-the-same-project-bf173e35fdef","title":"","type":null},"content":[{"type":"text","text":"https:\/\/towardsdatascience.com\/five-ways-to-work-seamlessly-between-r-and-python-in-the-same-project-bf173e35fdef"}]}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"link","attrs":{"href":"https:\/\/towardsdatascience.com\/generating-parameterized-powerpoint-documents-in-python-and-r-333368479038","title":"","type":null},"content":[{"type":"text","text":"生成參數化Powerpoint文檔"}]},{"type":"text","text":":"},{"type":"link","attrs":{"href":"https:\/\/towardsdatascience.com\/generating-parameterized-powerpoint-documents-in-python-and-r-333368479038","title":"","type":null},"content":[{"type":"text","text":"https:\/\/towardsdatascience.com\/generating-parameterized-powerpoint-documents-in-python-and-r-333368479038"}]}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"link","attrs":{"href":"https:\/\/towardsdatascience.com\/how-to-run-python-ml-algorithms-easily-in-r-7e3b0f7c7aee","title":"","type":null},"content":[{"type":"text","text":"在R中運行XGBoost"}]},{"type":"text","text":":"},{"type":"link","attrs":{"href":"https:\/\/towardsdatascience.com\/how-to-run-python-ml-algorithms-easily-in-r-7e3b0f7c7aee","title":"","type":null},"content":[{"type":"text","text":"https:\/\/towardsdatascience.com\/how-to-run-python-ml-algorithms-easily-in-r-7e3b0f7c7aee"}]}]},{"type":"heading","attrs":{"align":null,"level":4},"content":[{"type":"text","text":"作者介紹"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"一開始我是一名純數學家,然後我成爲了心理諮詢師和數據科學家。我很喜歡將所有這些學科的嚴謹思想應用在複雜的人性問題上。我也是一位編碼極客,還是日本RPG的忠實粉絲。可以在"},{"type":"link","attrs":{"href":"https:\/\/www.linkedin.com\/in\/keith-mcnulty\/","title":"","type":null},"content":[{"type":"text","text":"LinkedIn"}]},{"type":"text","text":"或"},{"type":"link","attrs":{"href":"https:\/\/twitter.com\/dr_keithmcnulty","title":"","type":null},"content":[{"type":"text","text":"Twitter"}]},{"type":"text","text":"上找到我。還可以查看我在drkeithmcnulty.com上的博客或我即將發佈的關於人類分析的"},{"type":"link","attrs":{"href":"https:\/\/www.routledge.com\/Handbook-of-Regression-Modeling-in-People-Analytics-With-Examples-in-R\/McNulty\/p\/book\/9781032041742","title":"","type":null},"content":[{"type":"text","text":"教科書"}]},{"type":"text","text":"。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"strong"}],"text":"原文鏈接:"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"link","attrs":{"href":"https:\/\/towardsdatascience.com\/why-choose-between-r-and-python-b12bf409d0d0","title":"","type":null},"content":[{"type":"text","text":"https:\/\/towardsdatascience.com\/why-choose-between-r-and-python-b12bf409d0d0"}]}]}]}
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章