There are two initial DF for 2015 and 2016 respectively:
FIRM x1 x2 x3 A 5 6 8 A 6 6 4 A 5 6 4 B 6 6 5 B 6 6 5 C 5 6 4 D 6 4 5
and
FIRM x1 x2 x3 B 5 6 8 C 6 6 4 F 5 6 4 B 6 6 5 B 6 6 5 A 5 6 4 A 6 4 5 This task continues: Merge frames, leave only those records that are found in all frames ( in a specific column) On these two examples, it is necessary to show how the various filtering methods work with: filter() . Specifically, what is the lambda x: x['YEAR'].nunique()==len(items) and how does it work?