Answer the question
In order to leave comments, you need to log in
Why was the original list not copied?
Why was the original list not copied?
def em(list_data):
with open('test2.json','r',encoding='utf-8') as file_json:
data_json = []
for item in file_json:
try:
data_json.append(json.loads(item))
except Exception as err:
print(err)
data_result = []
copy_list_data = list_data.copy()
for data in list_data:
for item in data_json:
if data['idnp'] in item[0] or data['idnp'] == item[0]:
data_result.append(item)
data.clear()
break
for data in list_data:
if data.get('idnp'):
data_result.append(list(data.values()))
print(copy_list_data)
["S18D8402100DY", "\u041a\u0410\u041f\u041e\u0422", "Chery", "0", "15", 11604.06, "BRAN", 11922.12, "TKUC", 11951.53, "FRZA", "None"]
idnp
, example{'idnp': 'F3102000C1', 'name': '', 'brand': 'LIFAN', 'min_count': 0, 'max_time_delivery': 15, 'count_sell': nan}
Answer the question
In order to leave comments, you need to log in
Need to use deepcopy https://docs.python.org/3/library/copy.html#copy.d...
You don't have jQuery included.
Above the script tag, paste this line:
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question