Stata/Python integration part 1: Setting up Stata


    Python integration is one of the most exciting features in Stata 16. There are thousands of free Python packages that you can use to access and process data from the Internet, visualize data, explore data using machine-learning algorithms, and much more. You can use these Python packages interactively within Stata or incorporate Python code into your do-files. And there are a growing number of community-contributed commands that have familiar, Stata-style syntax that use Python packages as the computational engine. But there are a few things that we must do before we can use Python in Stata. This blog post will show you how to set up Stata to use Python.


    Download and install Python

    You may already have Python installed on your computer. You can check by typing python search in Stata.

    The result tells us that no Python installations were found, so I will need to install Python. You may need to consult your system administrator if you are not the owner or administrator of the computer you are using.


    You can download an installation file for Python at the Python download website. Python is available for Linux, Mac, and Windows, so you should select the installation file that corresponds to your operating system. You should select a 64-bit installation file because Stata/Python integration works only with 64-bit processors. Python 3.8.5 is the current version as I am writing this post, and I recommend using the latest version. Older versions of Python are available for download if you need them for backward compatibility, but versions older than Python 3.0 have now reached “end of life” status.


    After you download the installation file, simply run it and follow the setup instructions. I have recorded a video that shows how to download and install Python for Windows 10 on a 64-bit computer.


    Download and install Anaconda/Python

    Python is also included in an open-source development environment called Anaconda. Many people prefer Anaconda because it automatically installs and manages many Python packages during installation. You can download the appropriate Anaconda installation file at the Anaconda download website. Anaconda is also available for Linux, Mac, and Windows, and you should select the 64-bit installation file that corresponds to your operating system. After you download the installation file, simply run it and follow the setup instructions. I have recorded a video that shows how to download and install Anaconda for Windows 10 on a 64-bit computer. 

    Setting up Stata to use Python

    After you install Python or Anaconda, or both, on your computer, you can return to Stata and again type python search in the Command window.

    I have installed both Python 3.8 and Anaconda 3.0 on my computer. I can tell Stata which Python installation I wish to use with the set python_exec command. The example below tells Stata that I wish to use Python 3.8.

    You can type python query to see which Python installation you are currently using.

    You can use set python_userpath to set additional paths for Python to look up packages and modules that you create or download. The example below uses set python_userpath to add the folder where I save my personal Python modules.

    You can type python query to see which Python installation you are currently using.

    Now we’re ready to use Python within Stata! You can begin using Python interactively by typing python in the Command window. Stata will remind you that you can type end to exit Python and return to Stata. The example below uses Python to print() the sentence “Hello Stata, I am Python” to the screen.

    It worked! This blog post is the first in a series that I am writing to show you how to use Python within Stata. My goal is to provide a basic foundation so that you will have the skills to explore Python packages that are useful to you. This post demonstrated how to install Python and set up Stata to use Python. In my next post, I will demonstrate several ways to use Python from within Stata.

    近期,武漢大學(xué)經(jīng)濟與管理學(xué)院聯(lián)合Stata軟件中國授權(quán)經(jīng)銷商北京天演融智軟件有限公司(科學(xué)軟件網(wǎng))在七-八月份舉辦Stata系列專題講座以及Stata軟件研討會,得到了大家的一致**。在此,科學(xué)軟件網(wǎng)為大家提供三場講座的回放以及“Stata洞察數(shù)據(jù)科學(xué)研討會” 中李春濤老師主講的主題為 “中文地圖與Stata” 和 肖光恩老師主講的主題為 “新冠疫情數(shù)據(jù)的可視化與建模方法” 的演講回放視頻,全部免費,可直接掃碼(頁面下方直接點 試聽 )免費觀看。

    北京天演融智軟件有限公司(科學(xué)軟件網(wǎng))是Stata軟件在中國的授權(quán)經(jīng)銷商,為中國的Stata用戶提供優(yōu)質(zhì)的軟件銷售和培訓(xùn)服務(wù)。



    北京天演融智軟件有限公司專注于matlab,stata,spsspro,pscad,gams,nvivo,cyme,gms,mathematica等

  • 詞條

    詞條說明

  • 好課免費享|SPSS統(tǒng)計分析及初中級應(yīng)用培訓(xùn)課程

    SPSS Statistics是**良好的統(tǒng)計分析軟件。IBM SPSS軟件平臺提供**統(tǒng)計分析、豐富的機器學(xué)習(xí)算法、文本分析、開源可擴展性、與大數(shù)據(jù)的集成以及無縫部署到應(yīng)用程序中等功能。是一款再調(diào)查統(tǒng)計行業(yè)、市場研究行業(yè)、醫(yī)學(xué)統(tǒng)計、**和企業(yè)的數(shù)據(jù)分析應(yīng)用中久負(fù)盛名的統(tǒng)計分析工具。IBM SPSS兼具易用性、靈活性和可擴展性,可以為具有各種技能水平的用戶提供服務(wù),并且?guī)椭湍钠髽I(yè)發(fā)現(xiàn)新機遇,

  • 案例分享 | DecisionTools和@RISK的簡單易用大大提高了交大師生們的研究效率

    上海交通大學(xué)密西根學(xué)院開設(shè)了DecisionTools Suite及@RISK軟件課程,受到了學(xué)生們的歡迎,他們利用這些軟件和知識在相關(guān)課題研究和工程中獲得了大量的研究成果和數(shù)據(jù),并且相較使用這些軟件前節(jié)省了大量的時間和工作,較大地提高了效率。?DecisionTools及@RISK在上海交大得到成功運用?上海交通大學(xué)密西根學(xué)院在李冕教授的帶領(lǐng)下,開設(shè)了DecisionTool

  • Stata圖書推薦|Maximum Likelihood Estimation with Stata

    Maximum Likelihood Estimation with Stata一書, 是各學(xué)科研究者在Stata中編寫較大似然(ML)估計量的重要參考和指南。除了全面介紹Stata編寫ML估計量的命令外,本書還概述了較大似然的基礎(chǔ)以及如何思考ML估計。*五版包含了新的*二章,該章演示了易于使用的mlexp命令。該命令允許您直接*似然函數(shù)并執(zhí)行估計,而*任何編程。?本書的**是Sta

  • HYDRUS模擬多孔介質(zhì)中水的流動和污染物的運移培訓(xùn)

    HYDRUS是一個運行于Windows系統(tǒng)下的環(huán)境模擬軟件,主要用于變量飽和多孔介質(zhì)的水流和溶質(zhì)運移。HYDRUS包括用于模擬變量飽和多孔介質(zhì)下的水、熱和多溶質(zhì)運移的二維和三維有限元計算,包括一個參數(shù)優(yōu)化算法,用于各種土壤的水壓和溶質(zhì)運移參數(shù)的逆向估計。該模型互動的圖形界面,可進行數(shù)據(jù)前處理、結(jié)構(gòu)化和非結(jié)構(gòu)化的有限元網(wǎng)格生成以及結(jié)果的圖形展示?!禜YDRUS模型應(yīng)用**培訓(xùn)班》已經(jīng)在中國成功舉辦四

聯(lián)系方式 聯(lián)系我時,請告知來自八方資源網(wǎng)!

公司名: 北京天演融智軟件有限公司

聯(lián)系人: 張經(jīng)理

電 話:

手 機: 18610814366

微 信: 18610814366

地 址: 北京海淀海淀上地東路35號院1號樓3層1-312318、1-312-319

郵 編:

網(wǎng) 址: turntech88.b2b168.com

相關(guān)閱讀

如何保養(yǎng)手動卷閘門的驅(qū)動裝置? BBIT殺菌劑的安全操作指南 使用薄膜濾器的范圍和注意事項介紹 青島回收老人牌環(huán)氧漆15590 2025年加拿大多倫多CBD電子yan展 CannExpo 陽泉|煤礦用防爆混凝土泵|HBMG系列主要技術(shù)參數(shù) 避炮棚:為爆破作業(yè)的安全保駕** 如何使用Prodigy邏輯分析儀 在 clock stretching 上實現(xiàn) pulse width 觸發(fā) 模組制氮機設(shè)備系統(tǒng)自動切換工作狀態(tài) 雙工位400A柴油發(fā)電電焊多功能機組 國家版體重管理指導(dǎo)原則發(fā)布,健康風(fēng)險評估是“必選項 花池磚價格 直埋鋼套鋼保溫鋼管性能特點 單機版閱卷系統(tǒng) 試卷閱卷機 答題卡閱卷機怎么用 2024沙特利雅得食品酒店展圓滿舉辦,25年沙特吉達食品酒店展報名中! GAMS建模入門課程 ELECTRO二維電氣設(shè)計軟件視頻教程 如何使用AquaChem管理和解釋水質(zhì)數(shù)據(jù) PSCAD/EMTDC軟件在新能源行業(yè)的**應(yīng)用培訓(xùn)在北京圓滿結(jié)束 活動 | MAXQDA中文名稱征集+網(wǎng)絡(luò)培訓(xùn) Mathematica 13.0 英文版已經(jīng)上線啦! 疫情期間,可申請遠(yuǎn)程使用Stata 好課免費享|SPSS統(tǒng)計分析及初中級應(yīng)用培訓(xùn)課程 Visual Modflow系列產(chǎn)品年底大促活動 案例分享 | @RISK在醫(yī)療行業(yè)的應(yīng)用案例 PSCAD V5 專題**講解 2019年Stata洞察數(shù)據(jù)科學(xué)大會及專題培訓(xùn)在武漢閉幕 Vensim 系統(tǒng)動力學(xué)軟件介紹 SigmaPlot 15較新介紹 (一) MAXQDA 免費初**培訓(xùn)
八方資源網(wǎng)提醒您:
1、本信息由八方資源網(wǎng)用戶發(fā)布,八方資源網(wǎng)不介入任何交易過程,請自行甄別其真實性及合法性;
2、跟進信息之前,請仔細(xì)核驗對方資質(zhì),所有預(yù)付定金或付款至個人賬戶的行為,均存在詐騙風(fēng)險,請?zhí)岣呔瑁?
    聯(lián)系方式

公司名: 北京天演融智軟件有限公司

聯(lián)系人: 張經(jīng)理

手 機: 18610814366

電 話:

地 址: 北京海淀海淀上地東路35號院1號樓3層1-312318、1-312-319

郵 編:

網(wǎng) 址: turntech88.b2b168.com

    相關(guān)企業(yè)
    商家產(chǎn)品系列
  • 產(chǎn)品推薦
  • 資訊推薦
關(guān)于八方 | 八方幣 | 招商合作 | 網(wǎng)站地圖 | 免費注冊 | 一元廣告 | 友情鏈接 | 聯(lián)系我們 | 八方業(yè)務(wù)| 匯款方式 | 商務(wù)洽談室 | 投訴舉報
粵ICP備10089450號-8 - 經(jīng)營許可證編號:粵B2-20130562 軟件企業(yè)認(rèn)定:深R-2013-2017 軟件產(chǎn)品登記:深DGY-2013-3594
著作權(quán)登記:2013SR134025
Copyright ? 2004 - 2025 b2b168.com All Rights Reserved