What is wrong with this code? def plotCountryDensities(data: pd.DataFrame, title: str): global inf """Visa stapeldiagram av lnders populationstthet. Args: data (pd.DataFrame): land data """ # Figur. fig, ax = plt.subplots() # Plotta data. ax = data.plot.bar( ax=ax, rot=40, x='country', y='density') ax.get_legend().remove() # Titlar. plt.title(title, color='b') plt.xlabel('Countries', color='r') plt.ylabel('Population density as persons/sqkm.', color='r') # A4, liggande. fig.set_size_inches(11.69, 8.27) # Visa. plt.grid() plt.show() def assignment_2_menu(data: pd.DataFrame) -> None: """Plotta populationsttheten fr vald antal lnder eller om landdet anges mend namn, skriv ut landets populationstthet. Args: data (pd.DataFrame): land data """ # Instruktion. print(''' Specify country/countries to show. Format: NAME | N[+|-] NAME = Name of country N = Integer between 1 and 10 + = Whow N densest countries - = Show N sparsest countries.''') # Loopa tills vi ftt rtt input. while True: # Ls in anvndarval. inputValue = input(" : ") # Testa med regex om anvndaren angav nummer. mo = re.match(r'^([0-9]{1,2})(+|-)?$', inputValue) # Har vi match object? if mo: # Ls nummer och eventuell postfix. num_countries = int(mo.group(1)) sort_type = mo.group(2) # Kolla att vi har nummer mellan 1 och 10. if 1 <= num_countries <= 10: if sort_type: # Vi har sortering. Sortera. ascending_ = sort_type == '-' subset = data.sort_values( by=['density'], ascending=ascending_ ).head(num_countries) side = 'lowest' if ascending_ else 'highest' title = f'{num_countries} countries with the {side} population density.' else: subset = data.head(num_countries) title = f'Population density for first {num_countries} countries.' # Plotta de 'num_countries' lnder vi har i subset. plotCountryDensities(subset, title) break else: # Anvndaren angav inte nummer i rtt format. # Testa om strngen matchar land. inputValue = inputValue.replace('"', '') searchResult = data.query(f'country=="{inputValue}"') if not searchResult.empty: # Rad hittades. print(f''' ---------- The population density for {inputValue} is {searchResult.iloc[0].density:.2f} individuals per square km. ---------- ''') break print('Invalid input.') # Titel print('nTask 2 - Plotn') # Skapa DataFrame objekt frn csv fil. df_cia_factbook = pd.read_csv('cia_factbook.csv', delimiter=';') # Berkna densitet fr alla rader och ta bort nan/inf rader. modified = df_cia_factbook.eval( 'density = population / area' ).query( 'density == density and density != @inf' ) # Visa-lnder meny. assignment_2_menu(modified) Task2-Plot NameError: name 're' is not defined.