Communities for your favorite technologies. Explore all Collectives
Stack Overflow for Teams is now called Stack Internal. Bring the best of human thought and AI automation together at your work.
Bring the best of human thought and AI automation together at your work. Learn more
Find centralized, trusted content and collaborate around the technologies you use most.
Stack Internal
Knowledge at work
Bring the best of human thought and AI automation together at your work.
gets the same columns asis equivalent to
df[['C', 'D', 'E']] # Mind, this makes# aor copy.
or
df.loc[:, ['C', 'D', 'E']] # This does not make a copy (better).
gets the same columns as
df[['C', 'D', 'E']] # Mind, this makes a copy.
is equivalent to
df[['C', 'D', 'E']] # or df.loc[:, ['C', 'D', 'E']]
is equivalent togets the same columns as
df[['C', 'D', 'E']] # orMind, this makes a copy.
To get the columns from CC to E E (note that unlike integer slicing, 'E'E is included in the columns):
C
E
The same works for selecting rows based on labels. Get the rows 'R6'R6 to 'R10'R10 from those columns:
R6
R10
To get the columns from C to E (note that unlike integer slicing, 'E' is included in the columns):
The same works for selecting rows based on labels. Get the rows 'R6' to 'R10' from those columns:
To get the columns from C to E (note that unlike integer slicing, E is included in the columns):
The same works for selecting rows based on labels. Get the rows R6 to R10 from those columns: