James Powell - Simple Simulators with pandas and Generator Coroutines | PyData NYC 2023

PyData
PyData
2 هزار بار بازدید - 9 ماه پیش - www.pydata.orgIn this tutorial, we will
www.pydata.org

In this tutorial, we will review some of the most parts of the Python programming language we don't use every day… but should! Using the motivating example of a portfolio construction backtester, we will build the rough outline of a library that allows users to design strategies to be automatically executed and evaluated for constructing a portfolio.
We will design this tool such that:
- it has moderate performance for low-frequency strategies (e.g., no intraday trading, no real-time, more mutual fund than hedge fund)
- it supports high generality in strategy construction
- it supports “foreign” data (i.e., it minimizes assumptions about pandas.Series or pandas.DataFrame representing market information or trades)
- it is reasonably easy for a pandas user to construct a strategy without knowing too many esoteric details of Python or pandas (except, of course, the rules of index alignment)
Along the way, we will look to answer the following questions:
- what are generators, generator coroutines, and decorators, and where do they they actually show up in analytical code?
- why are generators and generator coroutines so well-suited to the design of simulators, backtesters, model training, &c.?
- how do we write libraries that accept and return pandas.Series that do not lose generality?
- why is pandas often considered a “tail-end” analytical tool, and how might we solve the problem of writing libraries that may grow a pandas.Series?

PyData is an educational program of NumFOCUS, a 501(c)3 non-profit organization in the United States. PyData provides a forum for the international community of users and developers of data analysis tools to share ideas and learn from each other. The global PyData network promotes discussion of best practices, new approaches, and emerging technologies for data management, processing, analytics, and visualization. PyData communities approach data science using many languages, including (but not limited to) Python, Julia, and R.

PyData conferences aim to be accessible and community-driven, with novice to advanced level presentations. PyData tutorials and talks bring attendees the latest project features along with cutting-edge use cases.

00:00 Welcome!
00:10 Help us add time stamps or captions to this video! See the description for details.

Want to help add timestamps to our YouTube videos to help with discoverability? Find out more here: https://github.com/numfocus/YouTubeVi...
9 ماه پیش در تاریخ 1402/09/08 منتشر شده است.
2,023 بـار بازدید شده
... بیشتر