Created
January 25, 2017 20:11
-
-
Save kovid-rathee/65cc085c13567a82f52a3907910f113f to your computer and use it in GitHub Desktop.
Create a basic scatter plot using matplotlib on random data set generated by NumPy
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
import numpy as np | |
import pandas as pd | |
import matplotlib.pyplot as plt | |
# if you want a list of integers as your random data set | |
df = pd.DataFrame(np.random.randint(0,20,size=(20, 2)), columns=list('PQ')) | |
# if you want a list of random decimal numbers as your random data set | |
df = pd.DataFrame(np.random.randn(20,2), columns=list('PQ')) | |
# plot the data | |
plt.scatter(df.P,df.Q, alpha=0.5) | |
# plt.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment