# Comparing two Excel columns with Pandas and Numpy

Having been asked multiple times if I can quickly compare two numeric columns from an excel file, I set up a small Jupyter notebook (and an R script) to show the intersection, the union and set differences of two columns.

You can find the notebook on GitHub or read the code below. I hope it is useful.

A | B |
---|---|

1 | 10 |

2 | 20 |

3 | 30 |

4 | 4 |

5 | 40 |

6 | 1 |

7 | 2 |

If you donâ€™t have Numpy handy, take a look at Python sets.

I have also uploaded an equivalent version for R.

## Leave a Comment