text_html_output_1.png
import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)

df = pd.read_csv('/kaggle/input/salary-dataset-simple-linear-regression/Salary_dataset.csv')

df.columns

years_exp = df.YearsExperience.values
years_exp

salary = df.Salary.values
salary

x = years_exp
y = salary

plt.plot

x = x.reshape(-1, 1)
x

plt.scatter(x, y, color='blue')
plt.xlabel('YearsExperience')
plt.ylabel('Salary')
plt.plot