Skip to content

Instantly share code, notes, and snippets.

@momota10s
Created June 7, 2017 12:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save momota10s/97eb1fc2b3d1c07760ad542cba523b6a to your computer and use it in GitHub Desktop.
Save momota10s/97eb1fc2b3d1c07760ad542cba523b6a to your computer and use it in GitHub Desktop.
import pandas as pd
df=pd.DataFrame([[1,2,3],
[10,20,30],
[100,200,300],
[1000,2000,3000],
[1000,2000,3001],
[1000,2000,3002],
[1000,2000,3003]],
columns=['A','B','C'])
df2= df.iloc[[0,2,4,5,6]]
df2.iloc[2:4]
df2.ix[2:4]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment