import pandas as pd
import matplotlib.pyplot as plt
mtcars = pd.read_csv("https://raw.githubusercontent.com/plotly/datasets/master/mtcars.csv")
plt.scatter(x=mtcars.wt, y=mtcars.mpg)
plt.title("Miles per Gallon vs Weight")
plt.show()
Bletchley
June 21, 2024
import pandas as pd
import matplotlib.pyplot as plt
mtcars = pd.read_csv("https://raw.githubusercontent.com/plotly/datasets/master/mtcars.csv")
plt.scatter(x=mtcars.wt, y=mtcars.mpg)
plt.title("Miles per Gallon vs Weight")
plt.show()
The heavier the vehicle, the worse the gas mileage!