Questions tagged [percentage]

Percentage is a ratio or fraction of a quantity that shows the ratio from whole part of quantity. Percentage demonstrates how much is there out of 100.

The ratio or fraction from a quantity that consider out of 100 is called Percentage.

The Percentage is calculate by following formula:

percentage = (part of quantity * 100)/total quantity
2714 questions
5
votes
1 answer

Numpy 2D array get percentage of total

I just got started with numpy.. Got the below np table and would like calculate the each cell's percentage of the column total. data = np.array([[7,16,17], [12,11,3]]) headers = ["Grundskola", "Gymn", "Akademisk"] # tabulate data table =…
Line in Linus
  • 390
  • 8
  • 25
5
votes
2 answers

How to distribute percentages completely to set range in python?

I know the heading sounds confusing so I shall explain what I am trying to achieve here: EDIT: Code example, should add up to 24 but does not I have 10 data sources which all add up to my 11th data source. I want to display this data on a 24 RGB…
Luke Prior
  • 885
  • 2
  • 11
  • 34
5
votes
2 answers

How to display percentage along with bar chart

I already plot a bar chart for the data below Total Monthly Actual Hours Total Monthly Work Hours Activity Month Apr-19 35381.25 42592 May-19 31722.50 44528 Jun-19 …
Firdhaus Saleh
  • 189
  • 2
  • 13
5
votes
2 answers

Chart.js - How To Show Value of Label as Percent of X and Y Values - Currently Always 100%

I am using Chart.js along with a Chart.js plugin, chart-labels. I am wanting to show the labels at the top of the bar chart, and in the label show the percentage of the x value in relation to the y value (e.g., 16 is 94% of 17), but the label values…
Joyrex
  • 1,103
  • 14
  • 24
5
votes
1 answer

Why percentage value within grid-gap create overflow in CSS grid?

I'd like to have a grid like this: .grid{ display:grid; grid-gap:50%; background-color:blue; } .grid-1{ background-color:red; }
test
test
5
votes
3 answers

Get percentages of a column based off of another column but with different categories

I have the following Pandas Series: Count Pclass Survived 1 0 80 1 136 2 0 97 1 87 3 0 372 1 119 But I want something…
luminare
  • 363
  • 1
  • 2
  • 15
5
votes
2 answers

C# percent calculation with decimal type causes problems

decimal hundred = 100; decimal value = 5000; decimal sum = 1100000; decimal valuePercentOfSum = value / sum * hundred; //result = 0.4545454545454545454545454500M decimal percentOfSum = sum / hundred * valuePercentOfSum; //result =…
5
votes
5 answers

Calculate percentage given condition

I am new to this website and to coding as well. I was wondering if any of you could help me out I need to calculate the Top 5 Movies, by rating distribution, calculating the percentage of ratings for each movie that are 4 stars or higher. So far I…
bgg
  • 131
  • 7
5
votes
4 answers

Decreasing chance of choosing a number from a list of consecutive numbers

Say for example I am given the number 3. I then have to choose a random number from 0 to 3, but where 0 has a bigger chance of being chosen than 1, 1 has a bigger chance of being chosen than 2, and 2 has a bigger chance of being chosen than 3. I…
Jacques Marais
  • 2,666
  • 14
  • 33
5
votes
1 answer

Thymeleaf - formatting percentage with only two decimal numbers

I'm trying to formatting a percentage using Thymeleaf. But, with a % like 99.99, thymeleaf formats this value in 100. And I don't want it. I done this: Java side BigDecimal percentage = (a).multiply(new BigDecimal(100)).divide(b, 3,…
Dave
  • 1,428
  • 4
  • 31
  • 49
5
votes
2 answers

Calculate percentage/frequency of a value in a survey object

I have a national survey composed of many variables, like this one (for the sake of semplicity I omitted some variables): year id y.b sex income married pens weight 2002 1 1950 F 100000 1 0 1.12 2002 2 1943 M …
Laura R.
  • 99
  • 1
  • 10
5
votes
2 answers

R percentage of counts from a data.frame

I need to calculate the percentage of counts of variables and put it in a vector I have a frame as follows: group <- c('A','A','A','B','B','B') hight <- c('tall','tall','short','tall','short','short') group hight A tall A tall A …
Selrac
  • 2,203
  • 9
  • 41
  • 84
5
votes
4 answers

Simple Math Issue in C#

I have this program that takes 3 scores out of a possible 200 each then is supposed to get the average and display the percentage. but when i input numbers i get 00.0 as an answer. What could i be doing wrong? using System; using…
Fred
  • 51
  • 2
5
votes
2 answers

isNaN() javascript, number with 2 commas

I'm working with percentage and the setInterval() so I have a var intervalId; function randomize(){ var prc = $("#prc").val(); var c = 0 ; if (!intervalId){ intervalId = setInterval(function(){ …
Terry Rapt
  • 347
  • 2
  • 12
5
votes
2 answers

Is 70 ms 14% or 12% faster than 80 ms?

When we talk about performance, benchmarks, execution time, and we tend to say that implementation A is N percent faster/slower than implementation B, what exactly we mean? For example implementation A took 70 milliseconds, and B took 80…
exebook
  • 32,014
  • 33
  • 141
  • 226