[Solved] How to filter out only the number part (800000010627, 800000010040 and so on) from a list?


The easiest way: just cut the needed part from your bytes:

only_numbers = [item[18:] for item in initial_list]

This expression will create a new list named only_numbers with numbers extracted from original list items. Note that this method simply omits the first 17 symbols, so, if prefix part of your initial data will change in length this method may fail miserably.

If that prefix (div-num-expr::060) changes you will need to harness the power of regular expressions.

You can read more about regexes in python in the official documentation.

solved How to filter out only the number part (800000010627, 800000010040 and so on) from a list?