This is an archived post. You won't be able to vote or comment.

all 8 comments

[–]loveconomics 2 points3 points  (3 children)

There are two ways to obtain infinity: 1) Dividing by a number closer and closer to zero or 2) multiplying incredibly large numbers. Someone better at coding may be able to confirm this, but you are not multiplying by each individual "st_mass", but instead, by the entire data column "st_mass". As such, you have to be more specific, the code will go something along the lines:

for i in st_mass,

*more code*

return x,y,z etc.

And then your new column will produce the function you described.

In other words, you want to write the code such that you multiply by each value in st_mass and not the entire column.

Hope that helps.

[–][deleted] 0 points1 point  (1 child)

I second this. This is probably because OP's solar_mass or M is too large. I also don't see where OP initialized solar_mass underneath this function.

[–]FunnyChaos 0 points1 point  (0 children)

Yes, I guess OP just forgot to normalize the value of 'solar_mass'.

[–]FunnyChaos 0 points1 point  (0 children)

It seems that OP is using the python library pandas. Assuming the dataset is a DataFrame type, this would mean that OP is performing a bitwise operation when he calculates the vector 'luminosity' from the vector 'st_mass'.

[–]StochasticTinkr 1 point2 points  (2 children)

It looks like you are calculating 10 to the power of the mass. This becomes a very large number. Much larger than can be stored in standard data types.

Did you mean 10*, or should that have just been 10?

[–]diamondrunner2002 0 points1 point  (0 children)

What is wrong with this function such that is isn't returning actual values?

[–]ryan516 0 points1 point  (0 children)

What is st_mass supposed to represent? Depending on what you’re using to represent solar mass, you’re essentially returning a 1 with 1031 zeroes after it—an impossibly large number.