Skip to content

Unable to select subset of columns #464

Answered by risenW
eduardomanuel asked this question in Q&A
Discussion options

You must be logged in to vote

I have a Data Frame with a bunch of columns. I need to create a new Data Frame with just a subset of the columns from the orig Data Frame. Whenever i try to do that, i only get the last column specified.

I specify the subset like : my_df["col_1","col2","col_n"] ... I end up with a new Data Frame with just col_n

Is that a known bug or am i doing something wrong?

You should use the loc function instead. See https://danfo.jsdata.org/api-reference/dataframe/danfo.dataframe.loc

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@eduardomanuel
Comment options

Answer selected by eduardomanuel
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants