0

Hello I have DataFrame like below:

df = pd.DataFrame({"T1" : [1, 0, 1, 1],
                   "T2" : [0, 0, 0, 1], 
                   "ID" : ["1", "2", "3", "4"]})

And I need to draw bar chart with percentage distribution of T1 and T2 like below:

T11 = 75% because T1 has 75% of 1
T10 = 25% because T1 has 75% of 0

T21 = 25% because T1 has 75% of 1
T20 = 75% because T1 has 75% of 0

enter image description here

dingaro
  • 2,156
  • 9
  • 29
  • It is unclear what your problem is because you have not included your code attempt. Do you have problems calculating the percentages? Creating a bar graph? Labeling each column with the percentage? Please be more specific and provide your attempt with a specific problem. – Mr. T Jan 07 '21 at 10:22
  • Just to be clear: I do not think this is a duplicate. If you add details what you tried and what your exact problem is, I will vote to reopen the question. – Mr. T Jan 07 '21 at 13:26

0 Answers0