Posit Connect troubleshooting:

Hello all, I'm using a venv of python 3.9.13 and a requirements.txt in my project:

...
pandas                    2.0.0
plotly                   5.14.1
..

Two codes parts works locally but not on Posit Connect:

df = scope[["ID"] + [what]].groupby(["ID"]).nunique()

df["Share"] = df.groupby(
    level=0,
    as_index=False,
).apply(lambda x: round(100 * x / float(df[what].sum()), 2))

This part return locally the percentage and NaN on Posit Connect...

data = (
    data[["ID"] + [what, level]]
    .groupby([what, level])
    .nunique()
)

This return Error: incompatible index of inserted column with frame index (impossible to have multiple index).

In the log ONLY on Posit Connect, error is: ValueError: operands could not be broadcast together with shapes (2782,2) (3,) (2782,2).

It's possible the error is related to the python version on Posit Connect (3.10.6). However, if I use this version locally in place of 3.9.13, it works correctly. Anyone knows why? Thanks all!

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.