8
How should I format the percentage for this example?
import pandas as pd
flights = pd.read_csv('data/flights_until_june.csv', sep=',')
sum_null = flights.isnull().sum()
sum_null.sort_values(ascending=False, inplace=True)
total = flights.shape[0]
percentage = round(sum_null/total * 100, 2)
print(percentage)
print('{:2%}'.format(percentage))
Hello Ricardo, welcome to the Stack Overflow community in English! I believe the formatting you want is to show the percentage to two decimal places with the '%' sign at the end?
– user89389
Yes that’s what it is
– Ricardo Diz