Mar-02-2017, 11:20 AM
Dear Python Experts,
I an trying to convert my PopEst column so a thousands separator gets added.
The function '{:,}'.format(13213) #return '13,213' works fine when I put a number between the parenthesis myself
but I need it applied to my dataframe column "PopEst". I could not find a way to do that.
Is that possible?
Many thanks for any hints.
I an trying to convert my PopEst column so a thousands separator gets added.
def thirteen(): Top15 = answer_one() Top15['PopEst'] = Top15['Energy Supply'] / Top15['Energy Supply per Capita'] PopEst = Top15.ix[:,20] return PopEst #'{:,}'.format(13213) #return '13,213' answer_thirteen()
The function '{:,}'.format(13213) #return '13,213' works fine when I put a number between the parenthesis myself
but I need it applied to my dataframe column "PopEst". I could not find a way to do that.
Is that possible?
Many thanks for any hints.