slicing within `select()`
See original GitHub issueIs it possible to slice with the select()
verb?
For example, suppose I have a dataframe
df = pd.DataFrame({"a": range(3), "x" : range(3),
"y": range(3), "z": range(3)},
index=range(3))
I can do this
df >> select("x", "y", "z")
Is it possible in someway to do this via a slice "x":"z"
? I tried
edited
df >> select("x":"z") #corrected typo here "z" was "y"
and
edited
df >> select(("x":"z")) # corrected typo here "z" was "y"
with no success.
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Indexing, Slicing and Subsetting DataFrames in Python
Employ slicing to select sets of data from a DataFrame. ... In contrast, the copy() method for a DataFrame creates a true copy...
Read more >Subset rows using their positions — slice • dplyr
slice() lets you index rows by their (integer) locations. It allows you to select, remove, and duplicate rows. It is accompanied by a...
Read more >How to select every other using slicing in Python
First element 1 means you want to slice the element starting from its second element. The last element 2 is the interval (every...
Read more >slice: Subset rows using their positions in dplyr - Rdrr.io
slice() lets you index rows by their (integer) locations. It allows you to select, remove, and duplicate rows. It is accompanied by a...
Read more >How to Slice Columns in pandas DataFrame
In this article, I will explain how to slice/take or select a subset of a DataFrame by column labels, certain positions of the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I see the confusion. I mean, plydata implementing the
slice
function so that you (the user) can use it to select columns. It is not possible now, but it is good feature. I’ll add it may be tomorrow and make a release.Released in v0.3.2. You can now do
select(..., slice("x", "y"), ...)
.