arrrSample =
{'art_other_country_names': None,
'pk_ba_country_id': 186,
'sin_active': 1,
'txt_remarks': '',
'vhr_common_country_name': 'Uzbekistan',
'vhr_formal_country_name': 'Republic of Uzbekistan',
'vhr_nationality': '',
'vhr_short_country_name': '',
'vhr_transaction_currency_code': 'UZS'},
{'art_other_country_names': None,
'pk_ba_country_id': 185,
'sin_active': 1,
'txt_remarks': '',
'vhr_common_country_name': 'Uruguay',
'vhr_formal_country_name': 'Oriental Republic of Uruguay',
'vhr_nationality': '',
'vhr_short_country_name': '',
'vhr_transaction_currency_code': 'UYU'},
{'art_other_country_names': None,
'pk_ba_country_id': 184,
'sin_active': 1,
'txt_remarks': '',
'vhr_common_country_name': 'United States',
'vhr_formal_country_name': 'United States of America',
'vhr_nationality': '',
'vhr_short_country_name': '',
'vhr_transaction_currency_code': 'USD'},
This is the sample of data i get from database. How do i find the index in a single statement?
Eg if the nationality of the third entry is updated i require something like this:
arrrSample[index]['vhr_nationality'] ="American"
How do I find the index? I have the value 'pk_ba_country_id': 184
with me
which is arrrSample[2]['pk_ba_country_id'] =184
.
How do I find this index 2 from 184 without looping?
I need to find index from the value, I do not wish to use a loop the array as the database can contain large data .