Resources mentioned in this lesson:
Installing fg-data-profiling
00:00
In this lesson, I’ll show you how to install the fg-data-profiling package. First of all, in order to do that, I need to give you a little bit of a history lesson.
00:09
The fg-data-profiling package initially used to be called pandas-profiling, because it’s all about profiling data as represented as pandas DataFrames.
00:18
Then, over time, it was renamed to ydata-profiling, until eventually it reached its current name, which is fg-data-profiling. Now the code hasn’t really changed, the way you use the package hasn’t really changed, but if you find documentation online, you might see it referred to as either pandas-profiling or ydata-profiling, or its latest name, fg-data-profiling. To install the package, there are some prerequisites.
00:44
The first one is that at the time of recording this course, the fg-data-profiling package supports up to Python version 3.13, and no later. This may change in the future.
00:56
It also requires a specific version of the setuptools package, which is no later than version 81, and that’s because of compatibility issues.
01:05
Now because fg-data-profiling is a third-party package, it’s a good idea to install this in a virtual environment. This is so that it’s separate from other projects you might have.
01:16
In this specific course, we’ll be using a virtual environment that’s created using a tool called uv, that among other things can help us create and manage virtual environments.
01:26
You could manage the virtual environment in many other ways, such as using venv. For the installation, I’m going to assume you already have uv installed.
01:35
The first step is to set up a blank project using uv init. I can use the --python flag to specify that I would like to use Python version 3.13.
01:47 This will initialize the project. Now inside this project, I can set up the prerequisites, the additional libraries and packages that I would like installed.
01:57
Earlier I mentioned you need a specific version of setuptools, so you’ll add that here as well. You type uv add setuptools and then ==81 so that it’s a specific version of setuptools.
02:11
This will automatically set up the virtual environment with the correct version of Python and the correct version of setuptools already in place.
02:20
Now that you have your prerequisites installed, you can add the fg-data-profiling package itself. Again, like with setuptools, this is using the uv add command.
02:32
Back in the terminal, you type uv add fg-data-profiling, which is the exact name of the package. This will not only add fg-data-profiling, but all of its prerequisites.
02:47
So there you go. It’s installed quite a lot of different libraries, which are all required for fg-data-profiling to work correctly. Now before you can move on, it’s a good idea to test to make sure that this has been installed correctly.
02:59
To do this, create a blank Python script which will contain one line to import fg-data-profiling correctly. The specific import statement you need is from data_profiling import ProfileReport.
03:14 That’s the specific class you’re going to use later in the script.
03:20
And back in the terminal, because I’m using uv, I’m not going to use the Python command to run this script. I’m actually going to say uv run report.py, which will make sure to use the virtual environment created by uv.
03:37
So that’s finished with no output, but also no error message, which means that it was imported correctly. So now you’re ready to build a report. Before we move to the next lesson, I wanted to point you to a couple of resources if you want to read up on virtual environments or uv specifically.
03:54
There’s a tutorial specifically explaining the differences between installing something with uv and pip. And there’s also a tutorial that explains virtual environments in much more detail.
04:05
For the rest of this course, you’re going to see me use uv to manage the virtual environment and run the Python scripts. In the next lesson, it’s time to build your first profile report.
Become a Member to join the conversation.