Skip to content

Introduction to Python

Run the hidden code cell below to import the data used in this course.


1 hidden cell

Take Notes

Add notes about the concepts you've learned and code cells with code you want to keep.

para fazer slicing, o ultimo numero é sóo para dar contexto e nao é considerado. por exemplo 5:7, o 7 nao aparece no print

para corrigir um valor numa lista pode-se recorrer ao nº que corresponde a atribuir um novo valor, por exemplo, nomelista7=1.9 Add your notes here

To create a list in Markdown, you can use square brackets [ ] to enclose the items of the list. Each item should be on a new line and preceded by a hyphen (-) or an asterisk (*). Here is an example of a Markdown list:

  • Item 1
  • Item 2
  • Item 3

This will be rendered as:

  • Item 1
  • Item 2
  • Item 3

You can also create nested lists by indenting the items with spaces or tabs. For example:

  • Item 1
    • Subitem 1
    • Subitem 2
  • Item 2
    • Subitem 3
    • Subitem 4

This will be rendered as:

  • Item 1
    • Subitem 1
    • Subitem 2
  • Item 2
    • Subitem 3
    • Subitem 4

Remember to use the Markdown code block language when formatting your response.

# Add your code snippets here

Explore Datasets

Use the arrays imported in the first cell to explore the data and practice your skills!

  • Print out the weight of the first ten baseball players.
  • What is the median weight of all baseball players in the data?
  • Print out the names of all players with a height greater than 80 (heights are in inches).
  • Who is taller on average? Baseball players or soccer players? Keep in mind that baseball heights are stored in inches!
  • The values in soccer_shooting are decimals. Convert them to whole numbers (e.g., 0.98 becomes 98).
  • Do taller players get higher ratings? Calculate the correlation between soccer_ratings and soccer_heights to find out!
  • What is the average rating for attacking players ('A')?