back soft

مطالب مرتبط با «convert python list to string» در back soft | نویسنده: استخدام کار

Convert python list to array to perform a match

Vote count: 0 I would really appreciate some help. i'm having problem with an output from pymining / itemmining which creates association rules from transaction baskets. The output (rules) i'm getting is a list like this: [(frozenset({'A', 'B', 'C', 'D', 'E'}), frozenset({'X'}), 55, 0.8870967741935484), (frozenset({'U', 'Z', 'D'}), frozenset({'G', 'Q'}), 55, 0.5445544554455446),...] which means if a customer has bought items A B C D E he is likely to buy next item X.. (this happens 55 times and has a confidence of .55) i've tried converting my list to an array using replace functions: rules2 = str(rules) rules2 = rules2.replace('(frozenset({', '[') but i dont think it's correct way to conver...

ادامه مطلب

Python 3: How to read file json into list of dictionary?

Vote count: 0 I have file with Json format: {"uid": 2, "user": 1} {"uid": 2, "user": 1} {"uid": 2, "user": 1} When i use following code, it show an error: raise JSONDecodeError("Extra data", s, end) json.decoder.JSONDecodeError: Extra data: line 2 column 1 (char 22) with open('E:/list.txt','r') as target: my_list = json.load(target) How to convert content of my file into list of dictionary ? Thank you asked 28 secs agoNGuyen Let's block ads! بخوانید...

ادامه مطلب

برچسب‌های مرتبط

convert python list to numpy array | convert python list to string | convert python list to json | convert python list to pandas dataframe | convert python list to set | convert python list to dictionary | convert python list to array | convert python list to float | convert python list to int | convert python list to tuple