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

insert!(df,index,item,name) should modify df in place #646

Closed
floswald opened this issue Jul 9, 2014 · 2 comments
Closed

insert!(df,index,item,name) should modify df in place #646

floswald opened this issue Jul 9, 2014 · 2 comments

Comments

@floswald
Copy link
Contributor

floswald commented Jul 9, 2014

i was thinking that the ! in insert! modifies the dataframe in place. this doesnt seem to be happenign at the moment:

x = DataFrame(a=[1,2,3],b=rand(3))
insert!(x,3,rand(3),:newcol)
3x3 DataFrame
|-------|---|----------|----------|
| Row # | a | b        | newcol   |
| 1     | 1 | 0.622669 | 0.906544 |
| 2     | 2 | 0.983419 | 0.262162 |
| 3     | 3 | 0.480157 | 0.263939 |

julia> x
3x2 DataFrame
|-------|---|----------|
| Row # | a | b        |
| 1     | 1 | 0.622669 |
| 2     | 2 | 0.983419 |
| 3     | 3 | 0.480157 |

so i have to do x = insert!(x,...) which is somewhat counterintuitive.

@simonster
Copy link
Contributor

Please check out master and try again. I believe I fixed this in #634 but it hasn't made it into a release yet.

@floswald
Copy link
Contributor Author

floswald commented Jul 9, 2014

brilliant - thanks!

@floswald floswald closed this as completed Jul 9, 2014
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

2 participants