Skip to content

ENH: Add functions for creating dataframes with NaNs #6422

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 1 commit into from
Feb 25, 2014

Conversation

jseabold
Copy link
Contributor

Some convenience functions for making missing data.

@jseabold
Copy link
Contributor Author

My real use case is for statsmodels, so let me know if you think they're more appropriate there.

@jreback
Copy link
Contributor

jreback commented Feb 20, 2014

no these look reasonable

  • go ahead and merge in passing

r_idx_type=r_idx_type)

i, j = _create_missing_idx(nrows, ncols, density, random_state)
df.values[i, j] = np.nan
Copy link
Contributor

Choose a reason for hiding this comment

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

not a biggie, but you can do: df,iloc[i,j] will work when i and/oj are lists of indicies (what you are doing will be fine for a single dtype....mullti would break though)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok. Better fix then. Trying to understand changes since pandas internals got beyond my grasp, would this have worked at sometime before changes to handling of mixed dtypes?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nevermind, actually. This wouldn't work on a mixed type array either.

Copy link
Contributor

Choose a reason for hiding this comment

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

actually it will, but I think these functions create single types anyhow.

@jreback jreback added this to the 0.14.0 milestone Feb 25, 2014
jreback added a commit that referenced this pull request Feb 25, 2014
ENH: Add functions for creating dataframes with NaNs
@jreback jreback merged commit 63f46c1 into pandas-dev:master Feb 25, 2014
@jreback
Copy link
Contributor

jreback commented Feb 25, 2014

thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Testing pandas testing functions or related to the test suite
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants