Last active
September 12, 2019 01:29
-
-
Save Shogun89/ca01e3c4e0b6580b683534ce06b68b32 to your computer and use it in GitHub Desktop.
Body_Fat
This file contains 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
import pandas as pd | |
current_weight = 212 | |
body_fat_percentage = .3 | |
fat_pounds = current_weight* body_fat_percentage | |
def get_fat_percent(weight_lost, current_weight, fat_percentage): | |
new_fat = (current_weight*fat_percentage) - 2/3*weight_lost | |
fat_percent = new_fat/(current_weight-weight_lost) | |
return fat_percent | |
weights = range(5,5*18,5) | |
fat_percent = [get_fat_percent(weight, current_weight, body_fat_percentage) for weight in weights] | |
new_weight = list(map(lambda x: current_weight - x, weights)) | |
body_fat = [a*b for a,b in zip(new_weight,fat_percent)] | |
my_array = [fat_percent, weights, new_weight, body_fat] | |
dict = {'body_fat': fat_percent, 'weight_lost':weights ,'new_weight': new_weight, 'fat_lbs': body_fat} | |
df = pd.DataFrame(dict) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment