Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Lære Challenge 1 | Aggregating and Visualizing Data
Data Manipulation using pandas

book
Challenge 1

Let's practice building different kinds of plots! First, let's find out is there a relation between a dwelling value and major payments to secure shelter.

Oppgave

Swipe to start coding

  1. Initialize a scatter plot for the df dataframe.
  2. Display the 'valueh' column values on the x-axis, and the 'omphtotinch' values on the y-axis.
  3. Set color of points to orange (color, 'orange').

Løsning

# Importing the library
import pandas as pd

# Reading the file
df = pd.read_csv('https://codefinity-content-media.s3.eu-west-1.amazonaws.com/f2947b09-5f0d-4ad9-992f-ec0b87cd4b3f/data4.csv')

# Scatter plot dwelling value vs. major payments to secure shelter
df.plot(kind = 'scatter', x = 'valueh', y = 'omphtotinch', color = 'orange')

Alt var klart?

Hvordan kan vi forbedre det?

Takk for tilbakemeldingene dine!

Seksjon 4. Kapittel 9
# Importing the library
import pandas as pd

# Reading the file
df = pd.read_csv('https://codefinity-content-media.s3.eu-west-1.amazonaws.com/f2947b09-5f0d-4ad9-992f-ec0b87cd4b3f/data4.csv')

# Scatter plot dwelling value vs. major payments to secure shelter
df.___(kind = '___', ___, ___, ___)

Spør AI

expand
ChatGPT

Spør om hva du vil, eller prøv ett av de foreslåtte spørsmålene for å starte chatten vår

some-alt