We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I'm trying to weight a datset using the following code:
import weightipy as wp
gender_targets = {'Q2':{1:49, 2:51}} region_targets = {'Q4':{1:32, 2:23, 3:10, 4:14, 5:21}} scheme = wp.Rim('gender_and_age') scheme.set_targets(targets=[gender_targets, region_targets])
df["respid"] = range(len(df)) engine = wp.WeightEngine(data=df) engine.add_scheme(scheme=scheme, key="respid", verbose=False) engine.run() df_weighted = engine.dataframe() col_weights = f"weights_{scheme.name}"
respid, Q2, Q3 and Q4 are integer columns.
I get a long error message beginning with:
FutureWarning: Setting an item of incompatible dtype is deprecated and will raise an error in a future version of pandas.
Further down after a series of floating point numbers the error states:
has dtype incompatible with int64, please explicitly cast to a compatible dtype first.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I'm trying to weight a datset using the following code:
import weightipy as wp
Targets
gender_targets = {'Q2':{1:49, 2:51}}
region_targets = {'Q4':{1:32, 2:23, 3:10, 4:14, 5:21}}
scheme = wp.Rim('gender_and_age')
scheme.set_targets(targets=[gender_targets, region_targets])
df["respid"] = range(len(df))
engine = wp.WeightEngine(data=df)
engine.add_scheme(scheme=scheme, key="respid", verbose=False)
engine.run()
df_weighted = engine.dataframe()
col_weights = f"weights_{scheme.name}"
respid, Q2, Q3 and Q4 are integer columns.
I get a long error message beginning with:
FutureWarning: Setting an item of incompatible dtype is deprecated and will raise an error in a future version of pandas.
Further down after a series of floating point numbers the error states:
has dtype incompatible with int64, please explicitly cast to a compatible dtype first.
The text was updated successfully, but these errors were encountered: