slice dataframe by index into new dataframe code example
Example: make new dataframe from slice
# You need copy with boolean indexing, new DataFrame constructor is not necessary:
d2 = d1[d1.a > 1].copy()
# You need copy with boolean indexing, new DataFrame constructor is not necessary:
d2 = d1[d1.a > 1].copy()