Created
June 1, 2016 22:16
-
-
Save RobSpectre/52efd76a4d33832b19789a514af11f79 to your computer and use it in GitHub Desktop.
Calculate Net Promoter Score with Python lambda function
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nps = lambda x: float(((len([i for i in x if i > 8]) / len(x)) * 100) - ((len([i for i in x if i < 7]) / len(x)) * 100)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment