mysql - Python dictionary not storing all the rows in form of key value pair -


newbie in python. in below code fetching 4610 rows db , storing them in dictionary pattern. extracting rows till second last line of code , normalize() decimal values when printing len(sdivalues) 146. should 4600.

#len(sdidata) = 4610rows fetched mysql db  data in sdidata:     ibesticker =data[1].strip()   key = (data[0],ibesticker)   if(data[3] != none):     periodyear = datetime.datetime.strptime(data[3], "%y-%m-%d")     val = float(data[10].normalize())     print val  #returns 4600 values     sdivalues[key] = [periodyear.year, val, periodyear.month]   # wrong here guess  print len(sdivalues) # 146 rows 


Comments

Popular posts from this blog

networking - Vagrant-provisioned VirtualBox VM is not reachable from Ubuntu host -

c# - ASP.NET Core - There is already an object named 'AspNetRoles' in the database -

ruby on rails - ArgumentError: Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true -