Find Differences Between Two Columns of pandas DataFrame in Python (3 Examples) | equals() Function

Publicado el: 24 agosto 2022
en el canal de: Statistics Globe
2,766
23

How to compare two columns of a pandas DataFrame in the Python programming language. More details: https://statisticsglobe.com/find-diff...
Python code of this video:

import pandas as pd # Load pandas

data = pd.DataFrame({'x1':[1, 3, 2, 4, 7, 5], # Create first pandas DataFrame
'x2':['a', 'b', 'c', 'd', 'e', 'f'],
'x3':range(1, 7)})
print(data) # Print first pandas DataFrame

print(data['x1'].equals(data['x3'])) # Apply equals function
False

print(data['x1'] == data['x3']) # Apply logical operator
0 True
1 False
2 False
3 True
4 False
5 False
dtype: bool

print(data['x1'].isin(data['x3'])) # Apply isin function
0 True
1 True
2 True
3 True
4 False
5 True
Name: x1, dtype: bool

Follow me on Social Media:
Facebook – Statistics Globe Page:   / statisticsglobecom  
Facebook – R Programming Group for Discussions & Questions:   / statisticsglobe  
Facebook – Python Programming Group for Discussions & Questions:   / statisticsglobepython  
LinkedIn – Statistics Globe Page:   / statisticsglobe  
LinkedIn – R Programming Group for Discussions & Questions:   / 12555223  
LinkedIn – Python Programming Group for Discussions & Questions:   / 12673534  
Twitter:   / joachimschork  

Music by bensound.com


En esta página del sitio puede ver el video en línea Find Differences Between Two Columns of pandas DataFrame in Python (3 Examples) | equals() Function de Duración hora minuto segunda en buena calidad , que subió el usuario Statistics Globe 24 agosto 2022, comparta el enlace con amigos y conocidos, en youtube este video ya ha sido visto 2,766 veces y le gustó 23 a los espectadores. Disfruta viendo!