Skip to content

add a new feature sample() into groupby #1

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

Merged
merged 4 commits into from
Apr 16, 2020
Merged

Conversation

echozzy629
Copy link
Owner

@echozzy629 echozzy629 commented Apr 16, 2020


return(sample_dictionary)


Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove blank spaces here.

sample_keys=[]
for i in sample:
sample_keys.append(dictionary_keys[i])
sample_dictionary={key: value for key, value in groups_dictionary.items() if key in sample_keys}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

space around the equals sign

w=0

# Renormalize if don's sum to 1:
if(sum(weights)!=1):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove parenthesis around sum(weights) != 1

if(size==len(groups_dictionary) or frac ==1):
raise Warning("Random sample equals to the given groupbt: the inplut size is the same as the size of the input group")

if weights is not None:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change to if weights

@echozzy629 echozzy629 added the enhancement New feature or request label Apr 16, 2020
@devjeetr devjeetr merged commit 4712e4b into master Apr 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

test_timestamp:test_class_ops_pytz can fail due to bad luck of timing of calls
2 participants