Skip to content

Instantly share code, notes, and snippets.

@bhishanpdl
Last active September 1, 2018 01:22
Show Gist options
  • Save bhishanpdl/203a6c0cd2bd4f20b64a1583cb8193e9 to your computer and use it in GitHub Desktop.
Save bhishanpdl/203a6c0cd2bd4f20b64a1583cb8193e9 to your computer and use it in GitHub Desktop.
import pandas as pd
import string
df = pd.DataFrame({'c0':range(1,10), 'c1': list(string.ascii_letters[0:9])})
df2 = df.iloc[[0, -1]]
# first and last 10
df = pd.concat([df.head(10), df.tail(10)])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment