boxplot

Why won't my grouped box plot work in Python?

Why won't my grouped box plot work in Python? Question: I have a data set (my_data) that looks something like this: Gender Time Money Score Female 23 14 26.74 Male 12 98 56.76 Male 11 34 53.98 Female 18 58 25.98 etc. I want to make a grouped box plot of gender against score, so …

Total answers: 1

How to show last row of Pandas DataFrame in box plot

How to show last row of Pandas DataFrame in box plot Question: Random data: import numpy as np import pandas as pd import matplotlib.pyplot as plt data = pd.DataFrame(np.random.normal(size=(20,4))) data 0 1 2 3 0 -0.710006 -0.748083 -1.261515 0.048941 1 0.856541 0.533073 0.649113 -0.236297 2 -0.091005 -0.244658 -2.194779 0.632878 3 -0.059058 0.807661 -0.418446 -0.295255 4 …

Total answers: 1

Pandas min() arg is an empty sequence error (boxplot question)

Pandas min() arg is an empty sequence error (boxplot question) Question: I tired to make a boxplot which shows ‘age’ boxplot of ‘unsurvived’ male and female data. There’re some of empty data in raw. But some of them still have their own data. But it panadas shows ‘min() arg is an empty sequence’ How can …

Total answers: 1

How to set the colored boxes in a specific order in plotly box plot?

How to set the colored boxes in a specific order in plotly box plot? Question: I currently have a boxplot in plotly like so: Below is the Code I used to generate it: data = Audit_grouped[(Audit_grouped[‘type’] == t) & (Audit_grouped[‘rank_desc’] == i)] fig = px.box(data, x = "year", y = "hours", color = "results", color_discrete_map …

Total answers: 1

How to draw a boxplot from a DataFrame with lists in values?

How to draw a boxplot from a DataFrame with lists in values? Question: I have a following structure of the dataframe: data = [ [12, [0.1, 0.2, 0.3, 0.4, 0.5]], [14, [0.8, 0.7, 0.6, 0.4, 0.2]] # …. and so on ] df = pd.DataFrame(data, columns=[‘index’, ‘distribution’]) How to build a boxplot chart(s) where: each …

Total answers: 1

Boxplot whisker don't match the calculated values

Boxplot whisker don't match the calculated values Question: Here is the figure of the box plot I made using: plt.boxplot(data) I also calculated the values of Q1,Q3 Q1 , Q3 = np.percentile(data, [25,75]) Q1=101 Q3=123 Q1 and Q3 match the values of the box. IQR = 22 Q3+1.5*IQR = 156 Q1-1.5*IQR = 68 Q3+1.5IQR matches …

Total answers: 2

Create a Single Boxplot from Multiple DataFrames

Create a Single Boxplot from Multiple DataFrames Question: I have multiple data frames with different no. of rows and same no.of columns i.e DATA female_df1 = pd.DataFrame({‘ID’: [5,21,17], ‘value’: [85, 56.7, 77.9]}) female_df2 = pd.DataFrame({‘ID’: [75,1,7], ‘value’: [39, 66.7, 77.9]}) female_df3 = pd.DataFrame({‘ID’: [5,21,17], ‘value’: [85, 56.7, 77.9]}) female_df4 = pd.DataFrame({‘ID’: [5,21,17], ‘value’: [85, 56.7, …

Total answers: 1

Delete an artist from a figure

Delete an artist from a figure Question: I have a boxplot created with pandas (with all the lines saved in dict): tup = ….boxplot(column = [plot_it], by = ‘C’, ax = ax, return_type = ‘both’) How can I remove all the artists (lines added by the boxplot) from the figure,so that I can reuse those …

Total answers: 1

Showing both boxplots when using split in seaborn violinplots

Showing both boxplots when using split in seaborn violinplots Question: I would like to make split violin plots which also show the boxplots for both datasets, like in the figure of the question Seaborn: How to apply custom color to each seaborn violinplot? , problem is that when using split seaborn shows only one of …

Total answers: 1

Seaborn boxplot : set median color and set tick label colors to boxes color

Set custom median line color and set tick-label colors to boxplot face colors Question: I’m using this nice boxplot graph, answer from @Parfait. I got an out of bound error on j and had to use range(i*5,i*5+5). Why? I’d like to set the median to a particular color, let’s say red. medianprops=dict(color="red") won’t work. How …

Total answers: 2