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
- Initialize a scatter plot for the
df
dataframe. - Display the
'valueh'
column values on the x-axis, and the'omphtotinch'
values on the y-axis. - Set color of points to orange (
color
,'orange'
).
Løsning
9
1
2
3
4
5
6
7
8
# 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?
Takk for tilbakemeldingene dine!
Seksjon 4. Kapittel 9
9
1
2
3
4
5
6
7
8
# 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
Spør om hva du vil, eller prøv ett av de foreslåtte spørsmålene for å starte chatten vår