SyntaxFix
Write A Post
Hire A Developer
Questions
You can also use head and tail:
head
tail
In [29]: pd.concat([df.head(1), df.tail(1)]) Out[29]: a b 0 1 a 3 4 d