Answers for "pandas logical and two columns"

3

comparing two dataframe columns

comparison_column = np.where(df["col1"] == df["col2"], True, False)
Posted by: Guest on November-04-2020
2

create the dataframe column based on condition

df.loc[df['column name'] condition, 'new column name'] = 'value if condition is met'
Posted by: Guest on May-10-2020

Python Answers by Framework

Browse Popular Code Answers by Language