Santiago Moresi

Generation

generate functionFri, 16 Jun 2023

Esta función debe informar el consumo total para la entidad 'World' y año '2019', redondeado a 2 decimales, retornando ese valor en un dato de tipo float.

def get_total_consumption(df, entity, year): return round(df[(df['Entity'] == entity) & (df['Year'] == year)]['Oil Consumption'].sum(), 2) get_total_consumption(data_frames[0], 'World', 2019)

Want to kickstart your project?Use the new AI Studio to create your code