I'm very new to python and i'm trying to do a project for college.
The dataframe model is like this,

[Dataframe structure image]

![1](https://i.stack.imgur.com/uIkGv.png)

I want to generate an integer value for each customer\_id, this new value being the new customer\_id, where the customer\_id appears several times, I would like to convert this value to an integer, so that each time this Id appears it receives it, it always receives the same integer value.

I've tried some procedures so far, but it didn't work, one of them was

```
data['customer_id'] = data['customer_id'].rank(method='dense', ascending=False).astype(int)

```

But without success, is there any way to do this?