Demo entry 6352911

037

   

Submitted by anonymous on Mar 28, 2017 at 03:58
Language: Python 3. Code size: 318 Bytes.

import numpy as np
import matplotlib.pyplot as plt

score = np.genfromtxt('score.csv', delimiter=',', names=True)

x=score['math']
y=score['physical']
plt.scatter(x, y)
plt.xlabel('math')
plt.ylabel('pyhsical')
plt.title('math ~ physical')

a, b = np.polyfit(x, y, 1)
plt.plot(x, a*x+b, '-')

plt.show()

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).