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.
近期,武汉大学经济与管理学院联合Stata软件中国授权经销商北京天演融智软件有限公司(科学软件网)在七-八月份举办Stata系列专题讲座以及Stata软件研讨会,得到了大家的一致**。在此,科学软件网为大家提供三场讲座的回放以及“Stata洞察数据科学研讨会” 中李春涛老师主讲的主题为 “中文地图与Stata” 和 肖光恩老师主讲的主题为 “新冠疫情数据的可视化与建模方法” 的演讲回放视频,全部免费,可直接扫码(页面下方直接点 试听 )免费观看。
北京天演融智软件有限公司(科学软件网)是Stata软件在中国的授权经销商,为中国的Stata用户提供优质的软件销售和培训服务。
词条
词条说明
什么是GAMS MIROGAMS MIRO(具有快速编排的模型接口)是一种解决方案,可以轻松地将GAMS模型转换为交互式终端用户应用程序,可以分发给您的同事,甚至可以在web服务器上托管。 用户界面友好,允许您与底层GAMS模型交互,快速创建不同的场景,比较结果等等。MIRO广泛的数据可视化功能使您能够轻松创建强大的图表、时间序列、地图、小工具等。 您可以在几分钟内创建**个应
考试,是评估一个人能力的重要方式。无论是企业,还是事业单位,还是学校、教育机构,衡量一个员工或者一个学生阶段性的学习成果,大部分都会选择进行考核考试。作为教育评估指标体系之一的在线考试系统也成为了一个新的发展方向,在整个教学过程和教学结果中扮演着尤为重要的角色。一个完善、健全的考试系统能及时、准确地反馈教学结果,为教学提供更有意义的指导性策略,优化整个教学流程。一般教育所采用的传统考试模式,在如今
HOMER Energy公司的HOMER Pro微电网软件是优化微电网设计的**标准,适用于从乡村电力和岛屿公用事业到联网校园和军事基地的所有领域。HOMER(多能源混合优化模型)较初由国家可再生能源实验室开发的,并由HOMER Energy公司扩展功能和分销,它将三种强大的工具嵌套在一个软件产品中,使得工程和经济可以并行工作。仿真HOMER的核心是一个仿真模型。它试图模拟一个可行的系统,为您希望
本文旨在帮助用户选择合适的PSCAD的Fortran和C-code编译器。 PSCAD使用Fortran编译器和C语言编译器将Fortran代码和C语言代码编译为可执行的文件,启动可执行文件进行数值计算。在仿真过程中,这些结果被发送到PSCAD进行显示。 PSCAD支持两种编译器,GFortran 和 Intel compiler。GFortranGFort
公司名: 北京天演融智软件有限公司
联系人: 张经理
电 话:
手 机: 18610814366
微 信: 18610814366
地 址: 北京海淀海淀上地东路35号院1号楼3层1-312318、1-312-319
邮 编: