»  Home »  Resources & support »  Call Python from Stata

Call Python from Stata

In Stata 16.0 or higher, you can embed and execute Python code from within Stata. You can invoke Python interactively or in do-files and ado-files so that you can leverage Python's extensive language features. You can read more about using Python with Stata in [P] python.

Additionally, the Stata Function Interface (sfi) Python module is included which allows you to interact Python's capabilities with Stata's core features. Within the module, classes are defined to provide access to Stata's current dataset, frames, macros, scalars, matrices, value labels, characteristics, global Mata matrices, and more. See Stata's Python API documentation for more details.

You can read more about Python integration in [P] python.





The Stata Blog: Not Elsewhere Classified Find us on Facebook Follow us on Twitter LinkedIn YouTube Instagram
© Copyright 1996–2021 StataCorp LLC   •   Terms of use   •   Privacy   •   Contact us