I have following dataset
Item Count
A Sixty
A
A
B
B Thirty
B
Code to reproduce:
import pandas as pd
df = pd.DataFrame([
['A', 'Sixty'],
['A', ],
['A', ],
['B', ],
['B', 'Thirty'],
['B', ],
],
columns=['Item', 'Count'])
I want to copy the data of 'Count' in empty fields by matching 'Item'.so the output looks like this
Item Count
A Sixty
A Sixty
A Sixty
B Thirty
B Thirty
B Thirty