Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Python help!!!! Ok so I have this data code I made import numpy as np import mat

ID: 3559293 • Letter: P

Question

Python help!!!!

Ok so I have this data code I made

import numpy as np
import matplotlib.pyplot as plt
import matplotlib.colors as col
import pyfits

hdulist = pyfits.open('c:/users/Margie/downloads/asu (13).fit')
tbdata1= hdulist[1].data
print tbdata1.names

and this was the output.

Now I made a histogram like so

q= np.isfinite(p)

plt.hist(p[q],bins=40)

plt.show()

now i want to take to sets of data and make a histogram on top of a histogram. Could you first make me a function call the function and then make the histogram, then make some type of regression line?

Explanation / Answer

You could make a function like this

def hist()
   q= np.isfinite(p)

   plt.hist(p[q],bins=40)

   plt.show()

Make sure you type your 'tabs' properly as they are very important in python.

Call the function as shown below to get your desired result.

hist