Get startedGet started for free

Look before you leap: EDA before hypothesis testing

Kleinteich and Gorb (Sci. Rep., 4, 5225, 2014) performed an interesting experiment with South American horned frogs. They held a plate connected to a force transducer, along with a bait fly, in front of them. They then measured the impact force and adhesive force of the frog's tongue when it struck the target.

Frog A is an adult and Frog B is a juvenile. The researchers measured the impact force of 20 strikes for each frog. In the next exercise, we will test the hypothesis that the two frogs have the same distribution of impact forces. But, remember, it is important to do EDA first! Let's make a bee swarm plot for the data. They are stored in a pandas DataFrame, df, where column ID is the identity of the frog and column impact_force is the impact force in Newtons (N).

This exercise is part of the course

Statistical Thinking in Python (Part 2)

View Course

Exercise instructions

  • Use sns.swarmplot() to make a bee swarm plot of the data by specifying the x, y, and data keyword arguments.
  • Label your axes.
  • Show the plot.

Hands-on interactive exercise

Have a go at this exercise by completing this sample code.

# Make bee swarm plot
_ = ____

# Label axes
_ = plt.____('frog')
_ = plt.____('impact force (N)')

# Show the plot
____
Edit and Run Code