Created
January 30, 2024 11:10
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Create a scatter plot with a regression line using Matplotlib | |
plt.scatter(data['X'], data['Y']) | |
# Calculate the regression line | |
slope, intercept = np.polyfit(data['X'], data['Y'], 1) | |
# Plot the regression line | |
plt.plot(data['X'], slope * data['X'] + intercept, color='red', label='Regression Line') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment