[Pandas] || 2-step simple code with comments...
\n\n# Code\n\nimport pandas as pd\n\ndef actors_and_directors(actor_director: pd.DataFrame) -> pd.DataFrame:\n    # Group the data by actor_id and director_id, 
\n\n# Code\n```\nimport pandas as pd\n\ndef actors_and_directors(actor_director: pd.DataFrame) -> pd.DataFrame:\n    # Group the data by actor_id and director_id, and count the number of cooperations\n    grouped = actor_director.groupby([\'actor_id\', \'director_id\']).size().reset_index(name=\'cooperation_count\')\n    \n    # Filter the pairs where the cooperation count is at least three\n    filtered_pairs = grouped[grouped[\'cooperation_count\'] >= 3]\n    \n    return filtered_pairs[[\'actor_id\', \'director_id\']]\n\n```
['Pandas']