Python for Data Science: pandas & NumPy – quiz with 15 questions

NumPy arrays, broadcasting and masks, CSV import with Swiss peculiarities, loc and iloc, filtering, groupby, merge, pivot_table, and fast vectorised calculations instead of loops.

Questions
15
Level
Intermediate
Area
Programming & data · Data

Modules

Sample question

Warum ist eine NumPy-Operation wie a * 2 auf einem Array mit einer Million Zahlen viel schneller als eine Python-Schleife?

  • Python-Schleifen werden bei grossen Listen vom Interpreter automatisch gestoppt
  • NumPy schickt die Rechnung zur schnelleren Berechnung an einen Cloud-Dienst
  • Sie läuft vektorisiert in kompiliertem Code auf einem Speicherblock
  • NumPy rechnet nur jede zehnte Zahl exakt und schätzt den Rest hoch

Correct: Sie läuft vektorisiert in kompiliertem Code auf einem Speicherblock. Ein NumPy-Array speichert gleichartige Werte (z. B. float64) dicht hintereinander. Die Schleife läuft in C statt Element für Element im Interpreter – oft 10- bis 100-mal schneller.

More questions from the quiz

  • Was ergibt np.array([1, 2, 3]) + 10?
  • Was liefert a[a > 0] für a = np.array([-2, 5, 0, 7])?
  • Warum ändert b = a[0:2]; b[0] = 99 auch das ursprüngliche NumPy-Array a?
  • Wie liest man eine CSV-Datei mit Semikolon als Trennzeichen, wie sie Excel mit Schweizer Ländereinstellung oft erzeugt, in pandas ein?
  • Ein DataFrame hat die Kundennummern als Index. Was liefert df.loc[1001] im Unterschied zu df.iloc[0]?

The questions and explanations are in German – checked by experts, not machine-translated.

After every answer, Quizbot explains why it is right or wrong. Open questions come first, and progress is counted per topic. The quiz is free of charge; no account is needed.

As of 15.11.2026 · All quizzes

Quizbot – a project by AI SYSTEM, St. Gallen · Home