Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Press-Schechter function in python

  1. Jun 27, 2014 #1
    I want to write program in python that gives "redshift", range of "M" and range of "dn/dM" as input and plots "Press-Schechter" function and delivers a graph as output. would you please give some hints? I'm beginner in programming and I don't know how to start.
  2. jcsd
  3. Jun 28, 2014 #2


    User Avatar
    Science Advisor

    A good place to start learning Python would probably be the tutorials over at python.org, for example:

    The full tutorial can be found here:

    If you can get some understanding of python, when it's time to do the calculation you'll probably need to make use of the Python math library:

    In particular you'll have to use math.exp(), math.pi, math.sqrt(), and math.pow().

    To display the graph, try making use of pyplot:
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook