Skip to content
New issue

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

Deprecate MicroDataFrame.set_weight_col #208

Open
MaxGhenis opened this issue Mar 4, 2021 · 1 comment
Open

Deprecate MicroDataFrame.set_weight_col #208

MaxGhenis opened this issue Mar 4, 2021 · 1 comment

Comments

@MaxGhenis
Copy link
Collaborator

MicroDataFrame.set_weights already works passing in a string so set_weight_col seems redundant:

In [2]: d = mdf.MicroDataFrame({"x": [1, 2]}, weights=[3, 4])

In [3]: d.set_weights("x")

In [4]: d.weights
Out[4]: 
0    1.0
1    2.0
Name: x, dtype: float64

In [5]: d.set_weights([6, 7])

In [6]: d.weights
Out[6]: 
0    6.0
1    7.0
dtype: float64
@MaxGhenis
Copy link
Collaborator Author

Actually this doesn't work:

In [2]: d = mdf.MicroDataFrame({"x": [1, 2]}, weights=[3, 4])

In [3]: d.x.sum()
Out[3]: 11.0

In [4]: d.set_weights("x")

In [5]: d.x.sum()
Out[5]: 11.0

Still seems better to fix this and make set_weights work with both a column name and values than to have two.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant