pandas turn slice into 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()