RBSE SS Informatics Practices study materials
RBSE SS Informatics Practices study resources

RBSE SS Informatics Practices common mistakes

RBSE SS Informatics Practices · Understand the traps and how to avoid them.

Mistake 1

Writes df[0] or s[0] to reach the first row or first value, and gets a KeyError, or gets a row whose label happens to be 0 instead of the row in position 0.

Bracket indexing is label-based on a Series and column-based on a DataFrame; positional access requires .iloc. Practice data usually has a default RangeIndex where label and position coincide, so the habit looks correct until a custom index (e.g. roll numbers) appears.

What to do instead

State the index before indexing. Use df.loc[label], df.iloc[position] and df.loc[label, 'col'] explicitly, and allow s[0] only on a default integer index. Rehearse on a DataFrame built with index=['a','b','c'] until locating rows by label and by position is automatic.

Mistake 2

Tries to update values with `for i, row in df.iterrows(): row['marks'] += 5` and finds nothing changed, then switches to chained assignment such as df[df.marks > 50]['grade'] = 'A', which raises SettingWithCopyWarning and still may not write.

iterrows hands back a copy of each row, and chained indexing can act on a temporary object, so the assignment is discarded. The warning is easy to dismiss as harmless.

What to do instead

Assign through a single .loc call: df.loc[df.marks > 50, 'grade'] = 'A'. If a loop is genuinely needed, loop over df.index and write with df.loc[i, 'col']. Treat iterrows as read-only for inspection and printing.

Mistake 3

Writes df = df.dropna(inplace=True), or df = df.sort_values('marks', inplace=True), and the next line crashes with 'NoneType' object has no attribute 'head'.

inplace=True mutates the object and returns None, so the assignment overwrites the DataFrame with None. The two idioms are learned separately and then combined by accident.

What to do instead

Choose one style per call: either df.dropna(inplace=True) with no assignment, or df = df.dropna(). Apply the same rule to fillna, sort_values, reset_index and drop_duplicates, and check type(df) immediately after any cleaning step.

Mistake 4

Loads a marks CSV and finds df['marks'].mean() fails or describe() returns count/unique/top instead of mean and standard deviation, because a few cells contain blanks, 'AB', 'NA', or thousands separators like 1,200.

Pandas infers one dtype for the whole column, and a single non-numeric token demotes it to object. Exported school data routinely mixes absentees, dashes and formatted numbers.

What to do instead

Inspect df.dtypes and df.head() before any statistics. Read with pd.read_csv('marks.csv', na_values=['NA','AB','-',''], thousands=',') and convert with pd.to_numeric(df['marks'], errors='coerce'); then confirm df.isna().sum() and df.dtypes before calling mean() or describe().

Mistake 5

Calls plt.plot() three times in one script expecting three separate charts, and ends up with one figure where all three lines are superimposed; the result also has no axis labels, no title and no legend.

pyplot keeps drawing on the current axes until a new figure is created or show() is called. Labels are treated as decoration rather than part of the answer, so the chart cannot be interpreted.

What to do instead

Open a new plt.figure() before each chart, or use fig, axs = plt.subplots(1, 3). Give every chart plt.xlabel('Month'), plt.ylabel('Sales'), plt.title(...) and a legend when several series share axes, and finish the script with plt.show().

Mistake 6

Writes SELECT dept, AVG(salary) FROM emp WHERE AVG(salary) > 30000 GROUP BY dept; gets an error or empty output, then deletes the condition instead of relocating it.

WHERE filters individual rows before grouping and therefore cannot see aggregates; HAVING filters groups after GROUP BY. Both look like 'conditions', so the placement is chosen by guesswork.

What to do instead

Memorise the evaluation order FROM → WHERE → GROUP BY → HAVING → ORDER BY. Put row-level tests in WHERE and group-level tests in HAVING: SELECT dept, AVG(salary) FROM emp GROUP BY dept HAVING AVG(salary) > 30000. Write both versions once side by side.

Mistake 7

Uses WHERE marks = NULL or WHERE marks <> NULL, concludes that no student has a missing mark, and also writes COUNT(*) while claiming to have counted only students who actually scored.

NULL means unknown, so = and <> against it evaluate to unknown rather than TRUE; and COUNT(*) counts rows while COUNT(column) skips NULLs. The two subtleties are rarely practised on data that actually contains NULLs.

What to do instead

Use IS NULL and IS NOT NULL for missing values. Remember COUNT(*) counts rows, COUNT(col) counts non-null entries, and AVG/SUM ignore NULLs. Before answering, run the query on a small table with one NULL row so the difference in the output is visible.

Mistake 8

States that TCP is faster than UDP because it is 'more advanced', places HTTP at the transport layer next to TCP, and uses 'switch' and 'router' interchangeably when describing how a school LAN reaches the internet.

The protocol stack is memorised as a list of names without the job attached to each layer, and all connecting devices look alike because they all have ports.

What to do instead

Attach a unit of work to each layer: HTTP (application, request/response text), TCP (transport, ordered reliable segments, three-way handshake) and IP (internet, addressing and routing). Attach a field to each device: hub repeats to all ports, switch forwards by MAC address, router forwards by IP between networks.

Mistake 9

Defines a digital footprint as 'only what you deliberately post', so cookies, IP logs, location metadata and device data never appear in the answer; and labels any unauthorised copying of software as 'hacking' rather than an IPR or licensing violation.

Footprints are studied as social-media behaviour, and all wrongdoing is collapsed into one word, 'cybercrime'. The passive collection side and the legal categories are not separated in notes.

What to do instead

Split footprints into active (posts, comments, forms, uploads) and passive (cookies, IP address, browsing logs, location, device and transaction data) with one example each. Separate cybercrimes (phishing, identity theft, cyberstalking, hacking) from IPR breaches (piracy, plagiarism, licence violation) and name the remedy for each, e.g. software licence, copyright, patent.

Mistake 10

In the practical, runs CREATE TABLE and INSERT without declaring data types, primary key or NOT NULL, then submits a project report that is a list of code with no output, no table structure or DataFrame summary, and no conclusion.

The practical is treated as typing queries until one works rather than building and documenting a database or analysis. Marks for schema design, evidence of output and interpretation are then lost even when the queries are correct.

What to do instead

Define the schema first with explicit types (VARCHAR, INT, DATE), a PRIMARY KEY and NOT NULL, insert rows, and run SELECT * to show loaded data. For the report, fix a structure: aim, tools, schema or df.info() output, each code listing followed by a captioned screenshot of its output, findings, limitations and conclusion.