Project Euler 42 Coded Triangle Numbers

Опубликовано: 03 Февраль 2018
на канале: Jeffrey James
223
0

https://gist.github.com/jrjames83/990... (start from the import requests cell)

Using Pandas and Python to solve Project Euler #42, the triangle numbers problem. We read the terms into a pandas dataframe, write a function to map the string to the sum of the letter indices, then create a list of triangle numbers and further, create a new column to denote whether or not the word's score is in the list of triangle numbers.

We finally call value_counts() on the boolean outcome (in our out of the tri numbers) and find that 162 words were triangle terms.


На этой странице сайта вы можете посмотреть видео онлайн Project Euler 42 Coded Triangle Numbers длительностью часов минут секунд в хорошем качестве, которое загрузил пользователь Jeffrey James 03 Февраль 2018, поделитесь ссылкой с друзьями и знакомыми, на youtube это видео уже посмотрели 223 раз и оно понравилось 0 зрителям. Приятного просмотра!