Answers for "pandas dataframe from columns of another dataframe"

1

dataframe from another dataframe

new = old.filter(['A','B','D'], axis=1)
Posted by: Guest on March-02-2020
0

pandas dataframe column based on another column

df['c2'] = np.where(df.c1 == 8,'T', 'F')

   c1  c2  c3
0   4   F   1
1   8   T   9
2   1   F   8
3   3   F   5
4   3   F   8
Posted by: Guest on January-03-2022

Code answers related to "pandas dataframe from columns of another dataframe"

Python Answers by Framework

Browse Popular Code Answers by Language