22 topics

Data science help, from the join that duplicated all your rows

Your join returned more rows than the table you started with, and nothing downstream is trustworthy until you know why. That is the most common wasted afternoon in an intro data science course, and the cause is nearly always a key that is not unique on the side you assumed it was. Real analysis time goes to problems like this, not to the modelling everyone imagines the field is about.

Where students get stuck

My merge produced more rows than either table had

You had a many-to-many key. Before joining, count distinct values of the key and compare that to the row count on each side. If either side has duplicates, every match on the left pairs with every match on the right, and the output multiplies. Decide what you actually wanted: deduplicate the lookup table, aggregate the detail side first, or accept the fan-out because one order really does have several lines. The fix is upstream of the join, never a filter applied after it.

Do I drop the rows with missing values or fill them?

Ask why they are missing first, because that determines what is safe. If a sensor cut out at random, dropping loses precision but does not bias you. If income is blank mostly for people who declined to answer, dropping quietly removes a group and skews every conclusion you draw. Filling with the mean shrinks variance and invents certainty you do not have. A defensible middle path is to impute and add a boolean column marking which values were imputed, then report how many there were.

My plot won't work and the error mentions the column

Your data is almost certainly wide when the plotting library wants long. Wide means one column per year or per category, which reads nicely for humans. Long means one row per observation with a variable column and a value column, which is what grouping, faceting, and colouring by series all expect. Reshaping from wide to long is a single melt or pivot_longer call, and it resolves a surprising share of plotting errors that look like they are about the chart type.

I know correlation isn't causation, but what do I write instead?

Name the specific alternative explanation rather than reciting the slogan. There are three worth checking every time. Reverse causation: the outcome could be driving the predictor. A confounder: something else drives both, like warm weather driving ice cream sales and drownings. Selection: your sample was collected in a way that manufactured the pattern. Write the sentence as this association is consistent with X, but a study that did not randomise cannot rule out Y. That earns marks; the slogan alone does not.

My p-value is 0.06 and I don't know what to say about it

Say what it means and stop. A p-value is the probability of seeing data at least this extreme if the null hypothesis were true. It is not the probability the null is true, and 0.05 is a convention, not a law of nature. Report the effect size and the confidence interval alongside it, because a wide interval crossing zero is the honest description of what you found. And if you tested twenty things and reported the one at 0.04, mention that, since it is the number that changes how the result should be read.

What's covered

Data Science topics you can work through with a tutor, generate practice on, or turn into flashcards and a study plan.

Data wrangling

  • Tidy data principles and reshaping
  • Joins, keys, and merge behaviour
  • Missing values and imputation
  • Groupby and aggregation
  • Dates, time zones, and parsing
  • Outliers and data validation

Exploratory analysis

  • Distributions, skew, and summary statistics
  • Correlation and scatterplot reading
  • Histograms, box plots, and density plots
  • Chart choice and misleading axes

Statistics for analysis

  • Sampling and sampling bias
  • Confidence intervals
  • Hypothesis tests and p-values
  • A/B testing and multiple comparisons
  • Regression and interpreting coefficients

Tools and pipelines

  • Python with pandas and NumPy
  • SQL queries for analysis
  • Jupyter notebooks and reproducibility
  • R and the tidyverse

Communicating results

  • Writing up methods and limitations
  • Dashboards and audience-appropriate detail
  • Data ethics, consent, and anonymisation

Data Science questions

Can it look at my actual dataset?

It can see whatever is on your shared screen, so put the dataframe head, the shape, and the column types up and talk through them. That is usually faster than describing a schema aloud, and the mismatch you are hunting is often visible in the first ten rows.

I'm stuck on the write-up, not the code. Is that in scope?

Yes. Paste the draft of your findings section and ask for rubric-based feedback on it. Interpretation errors — overclaiming, omitting limitations, mislabelling a result as significant — are marked harder than a clumsy chart in most courses.

Will it just run the analysis for me?

It works through the reasoning with you: which grouping answers the question you were asked, whether the sample supports the claim. Handing over a finished analysis you cannot defend in a viva or a follow-up question does not help you, and your institution's integrity policy governs it either way.

I keep forgetting pandas syntax mid-assignment. Any help there?

Make flashcards from the operations you personally keep losing rather than a generic cheat sheet. Most people have four or five they re-look-up every single time, and drilling only those clears the bottleneck quickly.

Stuck on data science right now?

Talk it through out loud, share your screen, and watch it worked out step by step on a whiteboard.

Start free — no card