I have a DataFrame in the form of this picture:df1
I am trying to create a new column that would have a count of the times that each individual Administrative port showed in the dataset.df2
An idea I tried was to create a new DataFrame with each unique port as a row. Then iterate over each row and feed the value of each row into .value_counts as so.
for index, row in df2.iterrows():
df1['count'] = df1.value_counts().df2.row['Administrative port']