Is anyone familar with creating custom ratios to filter a universe? I'm attempting to sort with the below, but am running into issues. Any assitance would be appreciated.

sorted = sorted(fine, key=lambda x: x.FinancialStatements.BalanceSheet.TotalDebt.ThreeMonths / x.FinancialStatements.BalanceSheet.TotalCapitalization.ThreeMonths, reverse = False)

Author