0Pricing
Data Science Academy · Lekcja

Zależności: scatter i line

Wykreślanie dwóch zmiennych razem

Zależności: scatter i line to bezpłatna lekcja Data Science Academy na CoddyKit. To lekcja 3 z 4. Możesz przeczytać całą lekcję poniżej za darmo — a potem ćwiczyć ją interaktywnie w przeglądarce z wbudowanym edytorem kodu i tutorem AI dostępnym 24/7. To część ścieżki edukacyjnej Data Science Academy, a Twój postęp synchronizuje się między webem a aplikacją CoddyKit. Kurs Data Science Academy zawiera 4 lekcji w sumie.

Części tej lekcji nie zostały jeszcze przetłumaczone i są wyświetlane po angielsku.

From One Column to Two

Distributions look at a single column. Now you ask how two columns move together, which is the heart of finding a relationship.

The Scatter Plot

A scatter plot places one dot per row, using two columns as x and y. The cloud of dots reveals how the variables connect.

sns.scatterplot(data=df, x="hours", y="score")

Read the Pattern

Dots sloping up mean a positive link, sloping down means negative, and a shapeless blob means little correlation between them.

Add a Third Dimension With hue

Color the dots by a category using hue. Now one plot shows the relationship split across each group at the same time.

sns.scatterplot(data=df, x="hours", y="score", hue="grade")

Size Encodes a Fourth Variable

Map a column to dot size to pack in even more. Bigger dots can mean larger sales, population, or any numeric measure.

sns.scatterplot(data=df, x="hours", y="score", size="effort")

The Line Plot

When x is ordered, like dates or steps, a line plot connects the points to show how a value changes over that sequence.

sns.lineplot(data=df, x="month", y="revenue")

Scatter vs Line

Use a scatter for unordered pairs and a line when the x axis flows in order. Picking the right one keeps the trend honest.

Lines Aggregate Automatically

If several rows share an x value, seaborn averages their y and draws a shaded confidence band around the line for you.

Multiple Lines With hue

Add hue to a line plot and each category becomes its own colored line. Comparing trends across groups takes just one extra word.

sns.lineplot(data=df, x="month", y="revenue", hue="region")

Add a Trend Line With regplot

Want the best-fit line drawn through a scatter? regplot overlays a regression line so the direction is impossible to miss.

sns.regplot(data=df, x="hours", y="score")

Correlation Is Not Causation

A clear upward cloud shows two things rise together, not that one causes the other. Always pair a plot with judgment.

Quick Check

Your x axis is ordered by month and you want to show change over time.

Recap: Show How Two Things Connect

You can now reveal relationships with scatter for pairs and lines for ordered trends, and add hue or size to layer in more. 🔗

Często zadawane pytania

Czy lekcja „Zależności: scatter i line” jest bezpłatna?

Tak — pełny tekst „Zależności: scatter i line” jest dostępny za darmo tutaj w sieci. Aby ćwiczyć ją interaktywnie (wbudowany edytor kodu i tutor AI dostępny 24/7) i odblokować resztę kursu Data Science Academy, przejdź na CoddyKit PRO. Kurs Data Science Academy zawiera 4 lekcji w sumie.

Co nauczysz się w „Zależności: scatter i line”?

Wykreślanie dwóch zmiennych razem Ćwiczysz Data Science Academy z praktycznym kodem, który uruchamiasz bezpośrednio w przeglądarce, a tutor AI dostępny 24/7 odpowiada na Twoje pytania podczas pracy nad lekcją.

Czy potrzebuję doświadczenia, aby zacząć Data Science Academy?

Nie wymagamy żadnego doświadczenia. Data Science Academy w CoddyKit jest strukturyzowany dla początkujących i zaawansowanych użytkowników, więc możesz zacząć tutaj lub od początku i uczyć się w swoim tempie. To lekcja 3 z 4.

Ile czasu zajmuje lekcja „Zależności: scatter i line”?

Większość lekcji CoddyKit trwa około 5–10 minut. Każda lekcja to mały, interaktywny krok, dzięki czemu robisz systematyczne postępy i zawsze wracasz dokładnie do tego samego miejsca — na webie i w aplikacji.

Czy mogę pisać i uruchamiać kod w tej lekcji Data Science Academy?

Tak. Każda lekcja Data Science Academy zawiera wbudowany edytor kodu, więc piszesz i uruchamiasz prawdziwy kod bezpośrednio w przeglądarce i od razu otrzymujesz sprzężenie zwrotne od AI — bez konfiguracji na komputerze.

Wszystkie lekcje w tym kursie

  1. Dlaczego seaborn zamiast surowego matplotlib
  2. Rozkłady: hist, kde i box
  3. Zależności: scatter i line
  4. Facety, odcień i styl
← Powrót do Data Science Academy