text_plain_output_1.png
import pandas as pd

import pandas as pd
import numpy as np
import cv2 as cv
import matplotlib.image as mpimg
from matplotlib import pyplot as plt
pd.options.display.float_format = '{:.2f}'.format

training_labels = pd.read_csv('../input/landmark-recognition-2021/train.csv')
training_labels['path1'] = training_labels['id'].str.slice(start=0, stop=1)
training_labels['path2'] = training_labels['id'].str.slice(start=1, stop=2)
training_labels['path3'] = training_labels['id'].str.slice(start=2, stop=3)
training_labels['path'] = '../input/landmark-recognition-2021/train/' + training_labels['path1'] + '/' + training_labels['path2'] + '/' + training_labels['path3'] + '/' + training_labels['id'] + '.jpg'
training_labels = training_labels.drop(['path1', 'path2', 'path3'], axis=1)

piv = training_labels.pivot_table(index='landmark_id', aggfunc=lambda x: len(x.unique()))['id']
piv.sort_values()