Pandas returning index (columns not duplicated for grouping and selecting items)
Pandas returning index\nI like Panda\'s possibility to avoid repeating listing actor_id, director_id both for grouping and then final selecting items to return 
# Pandas returning index\nI like Panda\'s possibility to avoid repeating listing `actor_id`, `director_id` both for grouping and then final selecting items to return (as seen in the solution below).\n\n```\nimport pandas as pd\n\ndef actors_and_directors(actor_director: pd.DataFrame) -> pd.DataFrame:\n  return (actor_director\n    .groupby([\'actor_id\', \'director_id\'])\n    [\'timestamp\'].count()\n    .loc[lambda x: x >= 3]\n    .index.to_frame()\n  )\n```\n\n# Pandas using query\n```\nimport pandas as pd\n\ndef actors_and_directors(actor_director: pd.DataFrame) -> pd.DataFrame:\n  return (actor_director\n    .groupby([\'actor_id\', \'director_id\'], as_index=False)\n    [\'timestamp\'].count()\n    .query(\'timestamp >= 3\')\n    [[\'actor_id\', \'director_id\']]\n  )\n```\n\n# MySQL\n```\nselect\n  actor_id,\n  director_id\nfrom ActorDirector\ngroup by actor_id, director_id\nhaving count(`timestamp`) >= 3\n```
['MySQL', 'Pandas']