I have a list of lists and I am looking to remove items from the individual lists. The example list is as follows:
List = [[461, 'N', 'N', 547], [549, 'N', 'N', 623], [926, 'N', 'N', 'N', 'N', 1099], [1101, 'N', 'N', 'N', 'N', 1262], [1638, 'N', 'N', 'N', 'N', 1795], [1797, 'N', 'N', 'N', 'N', 1942], [2279, 'N', 'N', 2357], [2359, 'N', 'N', 2425], [2686, 'N', 'N', 2764], [2766, 'N', 'N', 2832], [3099, 'N', 'N', 3182], [3184, 'N', 'N', 3254], [3333, 'N', 'N', 3403], [3405, 'N', 'N', 3475], [3564, 'N', 'N', 3642], [3644, 'N', 'N', 3710]]
What is a way to remove all of the 'N' such that the resultant list would be:
[[461, 547], [549, 623], [926, 1099], [1101, 1262], [1638, 1795], [1797, 1942], [2279, 2357], [2359, 2425], [2686, 2764], [2766, 2832], [3099, 3182], [3184, 3254], [3333, 3403], [3405, 3475], [3564, 3642], [3644, 3710]]
For now the individual lists will always start and end with an integer. In between will be a combination of "Y"s and "N"s. I have done some logic filtering and now need to simplify the lists to only contain the numbers.
I have tried list comprehensions unsuccessfully. I also tried to implement a function to recursively replace the letters but I am trying to actually remove the items not replace, (see: https://stackoverflow.com/a/13782720/20786144).