目录
Python代码
import pandas as pd import statsmodels.api as sm import numpy as np import matplotlib.pyplot as plt data = pd.DataFrame({ 'country': ['USA', 'China', 'Romania', 'USA', 'India'], 'coach': ['Lang Ping', 'Lang Ping', 'Bela Karolyi', 'Bela Karolyi', 'Unknown'], 'gold_medals': [3, 4, 2, 5, 0], 'total_medals': [10, 12, 6, 15, 1], 'great_coach': [1, 1, 1, 1, 0], 'sports_investment': [1000000, 900000, 500000, 1100000, 100000],