I am new to Python and using Python 2.7 on Windows I am using Astropy library, but when I want to view an attribute on the following class:
>>> astropy.cosmology.FlatLambdaCDM.Ok0
it returns:
<property object at 0x7fa2c7e206d8>
Same for other attributes on that object. How do I access the numerical values?
I don't know anything about astropy myself, but from your description it soulds like Ok0
is a property of the FlatLambdaCDM
class. You're usually not supposed to try to access properties on a class directly, but rather through an instance of the class.
Try something like:
# create an instance
instance = FlatLambdaCDM() # the constructor may require some arguments
# access the property on the instance
instance.Ok0
I don't know what arguments (if any) the FlatLambdaCDM
class constructor requires, so you may need to add some more stuff to get a workable object.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With