Python Forum
Show empty categories in catplot with boxplots
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Show empty categories in catplot with boxplots
#1
I have a dataframe like:

ID * Period * value-system
1 * 2021-11 * 1010
2 * 2021-11 * 0
3 * 2021-11 * 988
4 * 2021-11 * 1023
5 * 2021-11 * 0
6 * 2021-12 * 0
7 * 2021-12 * 0
etc.

To create the boxplot I need (with sn catplot), I filtered the dataframe by leaving out all the rows with 0 for value-system. The result is shown in the following plot     .
Now, in the plot several periods are missing (2021-05 through 2021-08). These periods are present in the dataframe, but contain only 0-values, so left out by the filter. Now I want to show these 'missing' periods. With periods = df["Period"].unique() I can get all the periods I need, but how can I show these empty periods in the plot?

Hints are appreciated!
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  How to sort words to categories Ayran 1 27,574 Apr-06-2021, 03:25 PM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020