Varea Stack Troubles

Hi, I am struggling once again with CDS and stackers…

Here is my code

p.grid.minor_grid_line_color = '#eeeeee'

names = list(df.columns)
p.varea_stack(stackers=df.index, x=names, source=df)

output_notebook()
show(p)

'{"Month_01":{"Persistent":0.9995591963,"Reinitiate":0.0,"Switch":0.0,"Off-Therapy":0.0,"Discontinue":0.0004408037},"Month_02":{"Persistent":0.8587958711,"Reinitiate":0.0,"Switch":0.0,"Off-Therapy":0.1229842413,"Discontinue":0.0182198876},"Month_03":{"Persistent":0.6274841127,"Reinitiate":0.0064651214,"Switch":0.0003306028,"Off-Therapy":0.1821254087,"Discontinue":0.1835947544},"Month_04":{"Persistent":0.529956287,"Reinitiate":0.0545861955,"Switch":0.0005877383,"Off-Therapy":0.1635749183,"Discontinue":0.251294861},"Month_05":{"Persistent":0.473864012,"Reinitiate":0.0891892885,"Switch":0.0007346729,"Off-Therapy":0.1373838298,"Discontinue":0.2988281967},"Month_06":{"Persistent":0.404768027,"Reinitiate":0.1148661059,"Switch":0.0007346729,"Off-Therapy":0.1264004702,"Discontinue":0.353230724},"Month_07":{"Persistent":0.2485398376,"Reinitiate":0.1563383903,"Switch":0.0013958785,"Off-Therapy":0.1191639423,"Discontinue":0.4745619513},"Month_08":{"Persistent":0.1949454505,"Reinitiate":0.2244058333,"Switch":0.0037100981,"Off-Therapy":0.0585534291,"Discontinue":0.518385189},"Month_09":{"Persistent":0.1852845021,"Reinitiate":0.2575763141,"Switch":0.0049957756,"Off-Therapy":0.0252360137,"Discontinue":0.5269073945},"Month_10":{"Persistent":0.1716195864,"Reinitiate":0.271020828,"Switch":0.0055100467,"Off-Therapy":0.0139220512,"Discontinue":0.5379274878},"Month_11":{"Persistent":0.1623994416,"Reinitiate":0.2794328325,"Switch":0.0057304485,"Off-Therapy":0.0059508504,"Discontinue":0.5464864269},"Month_12":{"Persistent":0.1363920215,"Reinitiate":0.2835102671,"Switch":0.0060610513,"Off-Therapy":0.0023142196,"Discontinue":0.5717224406},"Month_13":{"Persistent":0.0847445175,"Reinitiate":0.2856775521,"Switch":0.0061712522,"Off-Therapy":0.0000367336,"Discontinue":0.6233699445},"Month_14":{"Persistent":0.0295338501,"Reinitiate":0.2857142857,"Switch":0.0061712522,"Off-Therapy":0.0,"Discontinue":0.678580612}}'

hi @Greg_Black Please edit your post to fix the code formatting, it’s tripple backticks ``` on separate lines before and after the entire code block.

@Greg_Black Really a complete code sample is needed. E.g. the snippet above does not show how you create your df from the raw data. Spending time speculating about bits you’ve left out or trying to fill in gaps means risking wasting time and effort solving the wrong problem. Generally, I am also happy to actually try something out to debug it directly, but only if it is complete and copy-pastable and runnable exactly as-is.

Thanks Bryan, I’ll keep that in mind when posting in the future. The problem is a lot of my data is sensitive.

Anyways, I figured out my issue (user error). Really appreciate you taking the time to respond.

Right in those situations folks usually synthesize fake data of some sort, that exhibits the same issue as the real data. That’s obviously a bit more work up front for you, but with ~1s or 10s of people answering questions and many 1000s of users asking questions, that’s also the only way things can work, realistically.

1 Like