1. Learn
  2. /
  3. Courses
  4. /
  5. Analyzing Financial Statements in Python

Exercise

Practice with sns.regplot()

In this exercise, you will check for any relationship between the operating margin and debt-to-equity ratio for all the companies in our dataset. You will first make a scatter plot to analyze the relationship and will be able to discern a relatively clear positive relationship between the debt-to-equity ratio and operating margin. Then you will use sns.regplot to get a line of best fit to confirm or reject the hypothesis that there is a positive relationship between the two ratios.

The pandas DataFrame dataset is loaded with debt-to-equity and operating margin ratio already computed. pandas and seaborn is loaded with alias pd and sns respectively.

Instructions 1/2

undefined XP
  • 1
    • Use Seaborn to make a scatter plot with the debt-to-equity ratio on the x-axis and the operating margin on the y-axis.
  • 2
    • Use Seaborn to make a scatter plot along with a line of best fit with debt-to-equity ratio on the x-axis and operating margin on the y-axis.