เริ่มต้นใช้งานเริ่มต้นใช้งานได้ฟรี

Industry attribution

In this exercise, you're going to calculate the relative industry position of your portfolio, versus a benchmark. As a portfolio manager you need to understand your portfolio's underweight and overweight positions (or "industry bets"), as they are a large driver of performance, as well as a potential source of risk.

The DataFrame portfolio_data is available, containing details about the industry classification, obtained from the Global Industry Classification System or "GICS", of your portfolio holdings, as well as your portfolio weights and the benchmark weights.

แบบฝึกหัดนี้เป็นส่วนหนึ่งของหลักสูตร

Introduction to Portfolio Analysis in Python

ดูคอร์ส

แบบฝึกหัดเชิงโต้ตอบแบบลงมือทำ

ลองทำแบบฝึกหัดนี้โดยเติมโค้ดตัวอย่างนี้ให้สมบูรณ์

# Print the sum of the bm and pf weights
print (portfolio_data.____.____())
print (portfolio_data.____.____())
แก้ไขและรันโค้ด