percentage

How to calculate percentage while matching columns on video_id?

How to calculate percentage while matching columns on video_id? Question: I am trying to calculate a percentage of users who view a specific video and those who do not. I managed to calculate the total number of videos and also total number of videos viewed by each group. However, when I try to calculate the …

Total answers: 1

how can i find percentage of the combination of the columns in pandas

how can i find percentage of the combination of the columns in pandas Question: I have following dataframe : enter link description here for dataframe I want output like this. according to week and classes. In the base of attendence where 1 count percentage of the classes & week. Asked By: Dipam Soni || Source …

Total answers: 1

Using Pandas to calculate the percentage of each index's values

Using Pandas to calculate the percentage of each index's values Question: I get stuck in pandas when I have a DataFrame like this: Person Fruit A Apple A Banana A Banana B Apple C Banana A Apple F Banana D Banana I need to calculate the percentage of each person’s different fruits, like A has …

Total answers: 1

Compare two lists and return match percentage while considering order

Compare two lists and return match percentage while considering order Question: I’m trying to write a program in Python that compares a list of inputs with an existing list then returns the match percentage between the two lists, as if it was verifying answers to an exam. print (‘Please answer the 20 questions with a, …

Total answers: 1

Pandas Percentage of Crosstab

Pandas Percentage of Crosstab Question: I have a dataframe ‘df’. I want to create a new column to add at the end of my crosstab. I used the following commands, but the percentages are displaying as NaN values for some reason. How do I fix this error? My code: trainData, validData = train_test_split(df, test_size=0.4, random_state=1) …

Total answers: 1

percentage of cells to row total python

percentage of cells to row total python Question: hi I have a dataset that looks much like this data frame below: #Table1 : print("Table1: Current Table") data = [[‘ALFA’, 35, 47, 67, 44, 193], [‘Bravo’, 51, 52, 16, 8, 127], [‘Charlie’, 59, 75, 2, 14, 150], [‘Delta’, 59, 75, 2, 34, 170], [‘Echo’, 59, 75, …

Total answers: 3

Is it possible to replace percentages with a phrase in a column?

Is it possible to replace percentages with a phrase in a column? Question: I have a table that I am turning into a graph, so I am making it so that the percentages are just whole numbers. For example: 63.9 would be 64%. I have some percentages that are less than 1%, and I would …

Total answers: 1

Transform decimal number to percentage and integer python

Transform decimal number to percentage and integer python Question: I have a column that I need to transform its value to percentage. example I have the value 0.166978 and I need to transform it into 16.70% I did it as follows df[‘EXAMPLE’] = df[[‘EXAMPLE’]].applymap("{:.4f}%".format) and got 0.1670% How do I change these decimal places to …

Total answers: 3

Pandas: How to calculate the percentage of one column against another?

Pandas: How to calculate the percentage of one column against another? Question: I am just trying to calculate the percentage of one column against another’s total, but I am unsure how to do this in Pandas so the calculation gets added into a new column. Let’s say, for argument’s sake, my data frame has two …

Total answers: 3

Calculate Percentage using Pandas DataFrame

Calculate Percentage using Pandas DataFrame Question: Of all the Medals won by these 5 countries across all olympics, what is the percentage medals won by each one of them? i have combined all excel file in one using panda dataframe but now stuck with finding percentage Country Gold Silver Bronze Total 0 USA 10 13 …

Total answers: 2