Return UNIQUE VALUES for EACH ROW | Solving Excel problems with Python | Excel to Python

preview_player
Показать описание
In this video I'm going to solve a problem that was originally posted on an Excel forum, except I'm going to solve it in python.

There are two solutions included:
(2) a one-line code with a list comprehension, removing duplicates with the set() function; more advanced, but the best option.

The intent is to give you some ideas and inspiration for solving problems in Python if you have traditionally worked exclusively in Excel. One of the hardest parts of that transition... if you didn't start out as a programmer... is finding ways to apply those programming skills to your everyday work. Hence, this notebook. This is by no means the best way to solve this problem. But, it requires no fancy libraries outside of what comes prepackaged with Python, so you won't need to learn another library to use this process. As with Excel, there are many, many ways to solve a problem in Python, and this is just one.

I've included a references section below that links to the relevant Python libraries and methods used in this exercise.

Why would you want to solve this in Python vs. Excel? Great question! First, you can certainly solve this problem in Excel with a formula. And in fact, VBA is a programatic option if you want to avoid using an Excel formula. However, this is a REALLY easy problem to solve in python that, once you become comfortable solving these kind so of problems, can be scaled to millions of rows and introduced into much more power python libraries such as numpy and pandas where you can do an incredible amount of cool calculations, manipulations, etc... all in the same environment. And, if you want to export that output into an Excel spreadsheet, that is no problem either.

Рекомендации по теме
visit shbcf.ru