So I have a list like this:
my_list = [{"id":21313,"remark":"","marks":"100"},
{"id":21314,"remark":"","marks":"29"},
{"id":21315,"remark":"","marks":"15"},
{"id":21316,"remark":"","marks":"50"},
{"id":21317,"remark":"","marks":"20"}]
The list have many elements. What I want to do is to iterate over the entire list,take a current element i as a point from which we check whether the marks of this point from the next two are more or less. If more than remark of good is made and if less than a remark of bad is made. This is what I want it to look like:
my_list = [{"id":21313,"remark":"good","marks":"100"},
{"id":21314,"remark":"bad","marks":"29"},
{"id":21315,"remark":"bad","marks":"15"},
{"id":21316,"remark":"NaN","marks":"50"},
{"id":21317,"remark":"NaN","marks":"20"}]
The last two are not available because there are not enough entries after them for comparison. Is there a way to do this?