2021年2月6日星期六

ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all() with dating the fossil question

I tried to wrote a piece of code when given the percent of carbon is still C 14, which is 35% and to calculate when the fossil formed. I assume it is between half life and twice the half life, therefore the range I offered: However, I received an error msg

t=np.arange(5730,5730*2,1)    while t in range(5730,5730*2):      if 0.5**(t/5700)>0.35:          t+=1      else:          break          print(t)  
---------------------------------------------------------------------------  ValueError                                Traceback (most recent call last)  <ipython-input-101-cb11e85c664a> in <module>        4 t=np.arange(5730,5730*2,1)        5   ----> 6 while t in range(5730,5730*2):        7     if 0.5**(t/5700)>0.35:        8         t+=1    ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()  
https://stackoverflow.com/questions/66083580/valueerror-the-truth-value-of-an-array-with-more-than-one-element-is-ambiguous February 07, 2021 at 09:04AM

没有评论:

发表评论