title: Getting NaN as output when rendering gpsd.fix.speed using python
body: <p>I am trying to get pygame to draw the output of gpsd.fix.speed.  For some reason it is drawing nan.  When I try printing gpsd.fix.speed i also get nan.  When I look at speed using cgps or xgps I can see the speed fine.  Any ideas on how to get this to work, or how to clean up my code (I'm sure it doesn't look really good).</p>
  
  <pre><code>import pygame
  import os
  import sys
  from gps import *
  from time import *
  
  size = (300,150)
  
  pygame.init()
  
  screen = pygame.display.set_mode(size)
  
  pygame.display.set_caption("Speedometer")
  
  pygame.key.set_repeat()
  
  gpsd = gps(mode=WATCH_ENABLE)
  
  def showSpeedo(speedoScreen):
             global gpsd
             global gpsspeed
             speedoScreen.fill((0,0,0))
             myfont = pygame.font.SysFont(None, 100)
  
             gpsspeed = str(gpsd.fix.speed)
  
             speedolabel = myfont.render(gpsspeed, 1, (2, 120, 245))
  
             textpos = speedolabel.get_rect()
             textpos.centerx = speedoScreen.get_rect().centerx
             textpos.centery = speedoScreen.get_rect().centery
  
             speedoScreen.blit(speedolabel, textpos)
  
             pygame.display.flip()
  
  quitloop=False
  
  refresh = 0
  
  while not quitloop:
      for event in pygame.event.get():
          if event.type == pygame.QUIT:
              quitloop = True
          if (event.type == pygame.KEYUP):
              if (event.key == pygame.K_q):
                  quitloop = True
  
      if pygame.time.get_ticks() &gt; refresh:
          showSpeedo(screen)
          refresh = pygame.time.get_ticks() + 500
  
   print "Exiting..."
  </code></pre>
  
  <p>Any help would be much appreciated!</p>