資料科學 教程
透過示例學習
使用我們的“自己嘗試”編輯器,您可以編輯 Python 程式碼並檢視結果。
示例
import pandas as pd
import matplotlib.pyplot as plt
from scipy import stats
full_health_data = pd.read_csv("data.csv", header=0, sep=",")
x = full_health_data["Average_Pulse"]
y = full_health_data["Calorie_Burnage"]
slope, intercept, r, p, std_err = stats.linregress(x, y)
def myfunc(x)
return slope * x + intercept
mymodel = list(map(myfunc, x))
plt.scatter(x, y)
plt.plot(x, mymodel)
plt.ylim(ymin=0, ymax=2000)
plt.xlim(xmin=0, xmax=200)
plt.xlabel("Average_Pulse")
plt.ylabel ("Calorie_Burnage")
plt.show()
自己動手試一試 »
單擊“Try it Yourself”按鈕檢視其工作原理。
Python 語言
Python 是一種被資料科學家廣泛使用的程式語言。
Python 擁有內建的數學庫和函式,使得計算數學問題和執行資料分析變得更容易。
在本教程中,我們將使用 Python 提供實際示例。
要了解更多關於 Python 的資訊,請訪問我們的 Python 教程。