my dataset looks like : service ftp_data other private http http private private private remote_job . . . .. I want the output to be: service 0 1 2 3 3 2 2 2 4 . . . ..
Asked
Active
Viewed 13 times
-2
-
use `df['new'] = pd.factorize(df['service'])[0]` – rafaelc Jun 04 '22 at 22:26
-
Hi, welcome to stackoverflow. Please review this https://stackoverflow.com/help/how-to-ask – Nohman Jun 04 '22 at 22:27