August 2019
Beginner
482 pages
12h 56m
English
Lastly, as we noticed, in some rows, the axis and allies parties are swapped. It is slightly confusing for this specific dataset. For example, in this dual model, we'll have to mark Soviets as axis when they attacked Poland during the initial stages of the war. Let's take a look at all the possible combinations:
battles['Belligerents.allies'].value_counts()
Here, value_counts() calculates a number of occurrences of each value. Hence, the index of those series represents unique values. There is a more intuitive alternative – the unique() function (which is also faster). However, this is a NumPy function and it returns a NumPy array, which Jupyter prints badly—that's the only reason we prefer to use value_counts.
From the examination, ...