Unable to convert a series into dictionary : <p>My function takes a data frame as an argument that represent home adverts from the website. I am counting flats by the number of rooms and receive series which I would like to convert into a dictionary. My <code>rooms counter</code> seems to be a series still after applying <code>to_dict()</code>. Tried also with <code>collections</code> but it is the same. </p>

<pre><code>def most_common_room_number(dane):
    rooms = dane['Rooms']
    rooms_counter = rooms.value_counts()
    rooms_counter.to_dict()
    # rooms_counter.to_dict(OrderedDict)
    # dd = defaultdict(list)
    # rooms_counter.to_dict(dd)
    print(rooms_counter)
</code></pre>
