title: converting object value into float in python
body: <p>i got timestamp returned as a tuple  from rrd database i.e. info variable will contain this</p>
  
  <blockquote>
    <p>[(38177492.733055562,
    38177482.886388876),(39370533.190833323, 40563588.018611118)]</p>
  </blockquote>
  
  <p>inside my code i am converting tuple (38177492.733055562,38177482.886388876) intto list using 
  list function after that i am accessing element using "index" variable and when i am passing this value to fromtimestamp function it is asking me the "float" value so how can i convert list object into float primitive data type ? following is the whole code</p>
  
  <pre><code>def hello(request):
  
          info = rrdtool.fetch('hello/test.rrd','AVERAGE','-r','3600','-s','1298264400','-e','1298350800')
  
      datalist = list()
      for index in range(0,len(info)):    
           val = list(info[index])
           dt_obj = datetime.fromtimestamp(float(val[index]))
           str=dt_obj.strftime("%d-%m-%Y %H:%M:%S")     
           datalist.append(str)
  
          data = simplejson.dumps(info, indent=4)
          return HttpResponse(data,mimetype='application/javascript')
  </code></pre>
  
  <p>i am getting following error </p>
  
  <pre><code>a float is required
  </code></pre>
  
  <p>after changing code to for index in range(0,len(info)): i am getting following error</p>
  
  <pre><code>invalid literal for float(): Out
  </code></pre>