ผู้เข้าชมที่เยี่ยมชมทั้งพิพิธภัณฑ์ที่เปิดก่อนปี 2009 และพิพิธภัณฑ์ที่เปิดหลังปี 2011 ชื่ออะไร
What is the name of the visitor who visited both a museum opened before 2009 and a museum opened after 2011?
df_visitor = pd.DataFrame(columns=['name', 'id']); df_museum = pd.DataFrame(columns=['Museum_ID', 'open_year']); df_visit = pd.DataFrame(columns=['visitor_id', 'Museum_ID'])
df_before = df_visit[df_visit['Museum_ID'].isin(df_museum[df_museum['open_year'] < 2009]['Museum_ID'])]['visitor_id'].values; df_after = df_visit[df_visit['Museum_ID'].isin(df_museum[df_museum['open_year'] > 2011]['Museum_ID'])]['visitor_id'].values; df_visitor.loc[df_visitor['id'].isin(np.intersect1d(df_before, df_after)), 'name']