Generation

generate functionWed, 18 Jan 2023

There is a Pandas dataframe: id title rating decade 4728 Bad Education (2019) 0.5 2010-2020 35638 35638 Palooka (1934) 0.5 1934 1930-1940 21445 21445 High Moon (2019) 0.5 2019 2010-2020 40291 40291 Saint Maud (2019) 0.5 2019 2010-2020 29462 29462 Mad at the Moon (1992) 0.5 1992 1990-2000 46978 46978 The Butterfly Ball (1977) 0.5 1977 1970-1980 42931 42931 Snowboarďáci (2004) 0.5 2004 2000-2010 38670 38670 Recon 2020: The Caprini Massacre (2004) 0.5 2004 2000-2010 25506 25506 Karagoez catalogo 9,5 (1983) 0.5 1983 1980-1990 43989 43989 Starting a Skyscraper (1902) 0.5 1902 1900-1910 Write code that shows the best decade with a maximum rating of 5.0

import pandas as pd df = pd.DataFrame( {'id': [4728, 35638, 21445, 40291, 29462, 46978, 42931, 38670, 25506, 43989], 'title': ['Bad Education (2019)', 'Palooka (1934)', 'High Moon (2019)', 'Saint Maud (2019)', 'Mad at the Moon (1992)', 'The Butterfly Ball (1977)', 'Snowboarďáci (2004)', 'Recon 2020: The Caprini Massacre (2004)', 'Karagoez catalogo 9,5 (1983)', 'Starting a Skyscraper (1902)'], 'rating': [0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5], 'decade': ['2010-2020', '1934', '2010-2020', '2010-2020', '1990-2000', '1970-1980', '

Questions about programming?Chat with your personal AI assistant