我有一些需要过滤的结构。有没有办法在 Python 中很好地做到这一点?
我有一种丑陋的做法,但我想清理它:
original_header = ['a','b','c']
original_rows = [[1,0,1], [0,0,0], [1,0,0]]
processed_header, processed_rows = some_cool_utility(original_header, original_rows)
assert_equals(['a', 'c'], processed_header)
assert_equals([[1,1], [0,0], [1,0]], processed_rows)