I'm trying to do Simple Random Sampling of a data in tableau using python by Tabypy server.
This is my code
SCRIPT_REAL(
"import pandas as pd
test=pd.DataFrame({'Case': _arg1,'fdr': _arg2,'site': _arg3,'acct': _arg4,'daykey':_arg5})
group=test.groupby(['Case','site'])
testing=group.apply(lambda x: x.sample(n=8,replace=True))
testing.drop_duplicates(keep=False,inplace=True)
testing.daykey=testing.daykey.astype('str')
return testing[_arg8]",
ATTR([R0 Type]),ATTR([Fdr Id]),ATTR([Agency name]),ATTR([Acct Id]),ATTR([Day key]),[Parameter 1])
But i'm getting the error
ValueError : not enough values to unpack (expected 2, got 0)
Thanks for the help