Feb-24-2019, 08:17 AM
(Feb-24-2019, 07:58 AM)searching1 Wrote: After running this from my original file which Im working, It's not writing any data on the CSV, maybe u have encountered/ any idea with this?I am not sure I understand this
(Feb-24-2019, 07:58 AM)searching1 Wrote: opo = [[ele] for ele in opo] - What we did here is we create a specifically significant variable(ELE) which we put the opo list into the ele list.
we use list comprehension.
ele
is just a variable that we used to convert the list to list of lists. we don't actually care about it, so we can reuse it in the list coprehension used to turn descname to list of listsopo = [[ele] for ele in opo]
is same as
new_opo = [] for ele in opo: new_opo.appned([ele]) opo = new_opo[:]
(Feb-24-2019, 07:58 AM)searching1 Wrote: then we put the list into zip and this itertools.izip_longest(*iterables[, fillvalue]) is fill all the blank data a loop until find the longest match/value.
it's same as zip, however if some of the iterables are shorter than others, it will use fillvalue to work as if they were equal length
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs