Listado de la etiqueta: Isin


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27

import pandas as pd
data = pd.DataFrame({
  ‘Name’: [‘A’, ‘B’, ‘C’, ‘D’],
  ‘Roll number’: [25, 45, 23, 32],
  ‘House’: [‘Blue’, ‘Green’, ‘Green’, ‘Yellow’]
})
 
 
df = pd.DataFrame({
  ‘Name’: [‘A’, ‘B’, ‘C’, ‘D’],
  ‘Roll number’: [25, 45, 23, 32],
  ‘House’: [‘Blue’, ‘Green’, ‘Green’, ‘Yellow’]
})
 
result = data.isin(df)
print(result)
 
print()
 
df = pd.DataFrame({
  ‘Name’: [‘A’, ‘B’, ‘C’, ‘D’],
  ‘Roll number’: [25, 45, 23, 32],
  ‘House’: [‘Blue’, ‘Green’, ‘Green’, ‘Yellow’]
})
 
result = data.isin(df)
print(result)



Source link