ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
* [ruby-core:81881] [Ruby trunk Feature#13706] Allow CSV#delete to delete multiple columns or add #delete_columns method
       [not found] <redmine.issue-13706.20170702090837@ruby-lang.org>
@ 2017-07-02  9:08 ` vla-dy
  2018-02-26 11:17 ` [ruby-core:85818] [Ruby trunk Feature#13706][Closed] " hsbt
  1 sibling, 0 replies; 2+ messages in thread
From: vla-dy @ 2017-07-02  9:08 UTC (permalink / raw
  To: ruby-core

Issue #13706 has been reported by wowinter13 (Vladislav Dyachenko).

----------------------------------------
Feature #13706: Allow CSV#delete to delete multiple columns or add #delete_columns method
https://bugs.ruby-lang.org/issues/13706

* Author: wowinter13 (Vladislav Dyachenko)
* Status: Open
* Priority: Normal
* Assignee: 
* Target version: 
----------------------------------------
I duplicated the main report message from this PR: https://github.com/ruby/csv/pull/4
The basic idea is that now we can delete only one column using #delete

`csv_table.delete("PassengerId")
csv_table.delete("Survived")
csv_table.delete("Name")
csv_table.to_csv`

The best working way for me to do it with multiple columns:
`
to_del = ["Name", "Ticket"]
csv_table = datus.by_col!.delete_if { |name, values| !to_del.include? name}`

But maybe it should work like this?
`
to_del = ["Name", "Ticket"]
data.delete(to_del)`




-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [ruby-core:85818] [Ruby trunk Feature#13706][Closed] Allow CSV#delete to delete multiple columns or add #delete_columns method
       [not found] <redmine.issue-13706.20170702090837@ruby-lang.org>
  2017-07-02  9:08 ` [ruby-core:81881] [Ruby trunk Feature#13706] Allow CSV#delete to delete multiple columns or add #delete_columns method vla-dy
@ 2018-02-26 11:17 ` hsbt
  1 sibling, 0 replies; 2+ messages in thread
From: hsbt @ 2018-02-26 11:17 UTC (permalink / raw
  To: ruby-core

Issue #13706 has been updated by hsbt (Hiroshi SHIBATA).

Status changed from Open to Closed
Assignee set to kou (Kouhei Sutou)

https://github.com/ruby/csv/pull/4 was already merged.

----------------------------------------
Feature #13706: Allow CSV#delete to delete multiple columns or add #delete_columns method
https://bugs.ruby-lang.org/issues/13706#change-70675

* Author: wowinter13 (Vladislav Dyachenko)
* Status: Closed
* Priority: Normal
* Assignee: kou (Kouhei Sutou)
* Target version: 
----------------------------------------
I duplicated the main report message from this PR: https://github.com/ruby/csv/pull/4
The basic idea is that now we can delete only one column using #delete

`csv_table.delete("PassengerId")
csv_table.delete("Survived")
csv_table.delete("Name")
csv_table.to_csv`

The best working way for me to do it with multiple columns:
`
to_del = ["Name", "Ticket"]
csv_table = datus.by_col!.delete_if { |name, values| !to_del.include? name}`

But maybe it should work like this?
`
to_del = ["Name", "Ticket"]
data.delete(to_del)`




-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-02-26 11:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <redmine.issue-13706.20170702090837@ruby-lang.org>
2017-07-02  9:08 ` [ruby-core:81881] [Ruby trunk Feature#13706] Allow CSV#delete to delete multiple columns or add #delete_columns method vla-dy
2018-02-26 11:17 ` [ruby-core:85818] [Ruby trunk Feature#13706][Closed] " hsbt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).