修正函式錯誤
指令碼編輯器中的程式碼應該會把上一個練習載入的 DataFrame 畫成圖表。
不過,函式語法有錯。記得常見的函式錯誤包含:
- 忘記關閉括號
- 忘記在每個引數之間加上逗號
注意,傳給這些函式的所有引數都是正確的。問題出在函式的語法。
本練習屬於課程
Python 的資料科學入門
練習說明
- 修正程式碼,讓它能在沒有語法錯誤的情況下執行。
動手互動練習
試著完成這個範例程式碼,體驗一下這個練習。
# One or more of the following lines contains an error
# Correct it so that it runs without producing syntax errors
# Plot a graph
plt.plot(x_values y_values)
# Display the graph
plt.show()