Session Ready
Exercise

Vectorization methods for looping a DataFrame

Now that you're familiar with vectorization in pandas and NumPy, you're going to compare their respective performances yourself.

Your task is to calculate the variance of all the hands in each hand using the vectorization over pandas Series and then modify your code using the vectorization over Numpy ndarrays method.

Instructions 1/2
undefined XP
  • 1
    • Calculate the variance of the ranks of all the cards in each hand using vectorization with pandas.
    • 2
      • Calculate the variance of the ranks of all the cards in each hand using vectorization with NumPy.