摘要: import pandas as pd import statsmodels.api as sm from statsmodels.formula.api import ols data = pd.DataFrame({ "city": [1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 阅读全文
posted @ 2024-12-07 14:50 Tsuki* 阅读(2) 评论(0) 推荐(0) 编辑
摘要: import pandas as pd import statsmodels.api as sm from statsmodels.formula.api import ols 读取 Excel 文件 data = pd.read_excel('9.4.xlsx') 定义模型 model = ols 阅读全文
posted @ 2024-12-07 14:34 Tsuki* 阅读(4) 评论(0) 推荐(0) 编辑
摘要: import pandas as pd import matplotlib.pyplot as plt import scipy.stats as stats 读取 Excel 文件中的数据 data = pd.read_excel('9.3.xlsx') # 将 'your_file.xlsx' 阅读全文
posted @ 2024-11-30 22:07 Tsuki* 阅读(2) 评论(0) 推荐(0) 编辑
摘要: import pandas as pd import scipy.stats as stats data = pd.read_excel('9.2.xlsx') data_values = data.values.flatten().tolist() statistic, p_value = sta 阅读全文
posted @ 2024-11-30 21:36 Tsuki* 阅读(3) 评论(0) 推荐(0) 编辑
摘要: loan_amount = 600000 - 200000 月利率 monthly_interest_rate = 0.0036 贷款期限(月) loan_term_months = 30 * 12 每月还款额 = 贷款本金×月利率×(1 + 月利率)^n÷((1 + 月利率)^n - 1),其中 阅读全文
posted @ 2024-11-23 16:14 Tsuki* 阅读(4) 评论(0) 推荐(0) 编辑
摘要: import numpy as np import matplotlib.pyplot as plt a = 1 - 0.2*(1/12) m = 1.109 * 10**5 w3 = 17.86 w4 = 22.99 X = [] Z = [] for k in np.arange(0, 0.87 阅读全文
posted @ 2024-11-23 16:04 Tsuki* 阅读(4) 评论(0) 推荐(0) 编辑
摘要: import numpy as np import matplotlib.pyplot as plt from scipy.integrate import solve_ivp plt.rcParams['text.usetex'] = False def model(t, y): f, df_dm 阅读全文
posted @ 2024-11-17 14:44 Tsuki* 阅读(5) 评论(0) 推荐(0) 编辑
摘要: import numpy as np from scipy.integrate import solve_ivp import matplotlib.pyplot as plt def differential_equations(t, z): x, y = z dx_dt = -x ** 3 - 阅读全文
posted @ 2024-11-17 14:38 Tsuki* 阅读(8) 评论(0) 推荐(0) 编辑
摘要: import numpy as np from scipy.interpolate import interp1d from scipy.integrate import quad import matplotlib.pyplot as plt g = lambda x: (3 * x ** 2 + 阅读全文
posted @ 2024-11-17 14:32 Tsuki* 阅读(2) 评论(0) 推荐(0) 编辑
摘要: import numpy as np from scipy.optimize import curve_fit, leastsq, least_squares import matplotlib.pyplot as plt def g(x, a, b): return 10 * a / (10 * 阅读全文
posted @ 2024-11-10 15:54 Tsuki* 阅读(2) 评论(0) 推荐(0) 编辑