hi All,
I have changed my code and its working fine. But yes Thanks for giving new solution of defult dict.
I have shared sample data , I have 2.5 million of rows and collision can happen so should I
this method
I have changed my code and its working fine. But yes Thanks for giving new solution of defult dict.
I have shared sample data , I have 2.5 million of rows and collision can happen so should I
this method
import json filename='C:/Users/pubhatia/Documents/learning/python/query/GEODATASOURCE-CITIES_1.TXT' #creating states dictionary object states ={} with open (filename) as fh: for line in fh: print(line) if line.strip(): k,v=line.split(' ',1) states[k] = v.split() if not bool(states): print ('Dict is Empty')