Screen Link:
My Code:
Replace this line with your code
f500["roa"] = f500["profits"] / f500["assets"]
top_roa_by_sector = {}
for sector in f500["sector"].unique():
is_sector = f500["sector"] == sector
sector_companies = f500.loc[is_sector]
top_company = sector_companies.sort_values("roa",ascending=False).iloc[0]
company_name = top_company["company"]
top_roa_by_sector[sector] = company_name
What I expected to happen:
i am not getting this flow
What actually happened:
Replace this line with the output/error
<!--Enter other details below: -->
can someone explain me this code,i am stuck