Answers for "add colum in pandadataframe calculating percentage"

0

add percentage column pandas

df['%'] = ((df['Code Lines'] / df['Code Lines'].sum())*100).round(2).astype(str) + '%'
Posted by: Guest on July-23-2020

Python Answers by Framework

Browse Popular Code Answers by Language