Task: Extract First and Last Row of a DataFrame in Pandas
Task: Extract First and Last Row of a DataFrame in Pandas: a task in Terminal-Lego-15k (Harbor dataset). Write a Python script that demonstrates how to correctly extract the first and last rows of a pandas DataFrame and return the result as a new DataFrame (not a Series or other data type).
The task
Write a Python script that demonstrates how to correctly extract the first and last rows of a pandas DataFrame and return the result as a new DataFrame (not a Series or other data type).
Part of PrimeIntellect/Terminal-Lego-15k.