Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import matplotlib.pyplot as plt
- import pandas as pd
- # Load the CSV data into a DataFrame
- df = pd.read_csv('draft2.csv')
- # Remove duplicates
- df = df.drop_duplicates()
- # Sort the DataFrame by the columns of your choice (e.g., X, Y)
- df = df.sort_values(by=['X', 'Y'])
- # Extract X and Y data
- x = df['X']
- y = df['Y']
- # Create a scatter plot
- plt.scatter(x, y)
- plt.xlabel('X')
- plt.ylabel('Y')
- plt.title('Scatter Plot of Cleaned X and Y Data')
- plt.grid(True)
- # Display the plot
- plt.show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement