import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
df = pd.DataFrame({'icao': ['kk','bb', 'a1', 'a1']})
df
icao
0 kk
1 bb
2 a1
3 a1
pd.DataFrame(data = {'icao': np.unique(df.icao, return_inverse=1)[1]})
icao
0 2
1 1
2 0
3 0
Write a comment:

*

Your email address will not be published.

© 2014 In R we trust.
Top
Follow us: