pandas extract columns to new dataframe code example
Example 1: copy only some columns to new dataframe in r
new = old[['A', 'C', 'D']].copy()
Example 2: copy only some columns to new dataframe in r
new = pd.DataFrame([old.A, old.B, old.C]).transpose()