*range_features

    xx, yy = np.meshgrid(
        np.arange(*range_features[feature_names[0]], plot_step),
        np.arange(*range_features[feature_names[1]], plot_step),
    )

Hey in this part of the plotting class what is the meaning of

*range_features[feature_names[0]
in

np.arange(*range_features[feature_names[0]], plot_step)

I understand that range_features is a dictionary, I am confused because I pointers aren’t allowed in python.

Hi Harshit_Sati,

In Python, the ‘*’ is used when you want to pass arguments contained in a list or a tuple to a function.
foo(*args) means you pass several arguments contained in a list or a tuple to the function foo().
Here range features is a dictionary indeed:

but the values of that dictionary are the range of culmen length and depth as tuples.

feature_names is the list of the keys of range_features. So =>

range_features[feature_names[0]] == range_features["Culmen Length (mm)"] == (31.1, 60.6)

in the function plot_step = 0.02 so =>

np.arange(*range_features[feature_names[0]], plot_step) == np.arange(*(31.1, 60.6), 0.02) == np.arange(31.1, 60.6, 0.02)

I hope I helped you to understand the code.

If you have any other question do not hesitate.

A nice tutorial for the use of *args and **kwargs in Python: here

3 Likes

yes thank you, that cleared all my doubts, I assumed it to be related to pointers :sweat_smile:, also it seems like the question was in a wrong thread