Is there a Difference between using target_name, and just target_name when using drop function?

data = adult_census.drop(columns=[target_name, ])

data = adult_census.drop(columns=[target_name])

A comma at the end of a series of values in an array or array like object is called a trailing comma, e.g., [1, 2, 3, ]. They are ignored by the compiler and are particularly useful when generating code for populating a list: just generate a sequence of elements and commas, no need to consider the last one as a special case that shouldn’t have a comma at the end.

1 Like

Here is a great answer I found