RBSE SS Informatics Practices cheat sheet
RBSE SS Informatics Practices · Keep the key ideas within reach.
Data Handling using Pandas: Series and DataFrame creation, indexing, slicing, iteration, and basic operations
pd.Series(data, index=None, dtype=None, name=None) accepts a list, tuple, scalar, dictionary or NumPy array; a dictionary's keys become the index and its values the data.
Series attributes: .values (NumPy array), .index, .dtype, .name, .size, .shape (n,), .empty; a Series is one-dimensional, a DataFrame is two-dimensional.
DataFrame creation: pd.DataFrame(dict_of_lists) makes keys the columns; pd.DataFrame(list_of_dicts) also takes keys as columns; a 2D ndarray needs index/columns passed separately; a dict of Series aligns on index.
Label indexing df.loc[row_label, col_label] includes the stop label in slices, while positional df.iloc[r, c] excludes the stop; s[1:4] on a default RangeIndex Series uses position.
Boolean masking: s[s > 50] keeps elements where the condition is True; df[df['marks'] >= 40] filters rows; combine conditions with & and | inside parentheses.
Iteration: for col in df yields column names; df.items() yields (column_name, Series); df.iterrows() yields (index, Series) per row; iterating a Series yields its values.
Arithmetic on two Series aligns by index label, not position; unmatched labels give NaN - use s1.add(s2, fill_value=0) to avoid it.
Structural operations: df.head(n), df.tail(n), df.T, df.set_index('col'), df.reset_index(), df['new'] = value adds a column, and del df['col'] or df.pop('col') removes one.
Data Handling using Pandas: importing/exporting CSV data, cleaning, joining, and descriptive statistics
pd.read_csv(path, sep=',', header=0, names=[...], index_col=None, usecols=[...], nrows=n, skiprows=n, na_values=[...], dtype={...}) returns a DataFrame; header=None treats the first row as data.
df.to_csv(path, index=True, header=True) writes row labels by default; pass index=False to export only the data columns.
Checks after import: df.shape, df.info() (dtypes and non-null counts), df.head(), df.isnull().sum(), df.duplicated().sum().
Missing data: df.dropna(axis=0, how='any', subset=[...]) removes rows with any null in the subset; df.fillna(0) or fillna(method='ffill') replaces them; df.drop_duplicates(subset=['col'], keep='first') removes repeats.
Column handling: df.rename(columns={'old':'new'}, inplace=True) or df.columns = [...] renames; df['col'].astype(int) changes dtype.
Joining: pd.merge(left, right, how='inner'|'left'|'right'|'outer', on='key') matches on key columns; df.join(other) defaults to a left join on the index; pd.concat([d1,d2], axis=0) stacks rows and axis=1 adds columns.
df.describe() returns count, mean, std, min, 25%, 50%, 75%, max for numeric columns; include='all' adds object columns; NaN values are skipped.
Aggregations df.mean()/sum()/count()/min()/max()/median()/mode()/var()/std() default to axis=0 (down each column), axis=1 works across a row; df['col'].value_counts() gives frequencies; df.corr() gives pairwise correlation.
Data Visualization: matplotlib pyplot, line/bar/histogram/scatter plots, labels, titles, and interpretation
import matplotlib.pyplot as plt; plt.plot(x, y) draws a line, plt.bar(x, height) a bar chart, plt.hist(data, bins=10) a histogram, plt.scatter(x, y) a scatter plot, and plt.show() displays the figure.
Labels and title: plt.title('...'), plt.xlabel('...'), plt.ylabel('...'), plt.legend(), plt.grid(True) - all called before plt.show().
Plot-choice rule: line = trend over ordered values such as time; bar = comparison of categories; histogram = distribution of one continuous variable; scatter = relationship between two numeric variables.
Multiple lines: call plt.plot twice with label='...' then plt.legend(); plt.figure(figsize=(8,4)) sets size; plt.xticks(rotation=45) tilts category labels.
Style arguments: color='r', marker='o', linestyle='--', linewidth=2, alpha=0.5; plt.xlim(a,b) and plt.ylim(a,b) set axis ranges.
In plt.hist(), bins sets the number of class intervals and the y-axis is frequency (count) by default; density=True makes it a probability density.
plt.savefig('plot.png', dpi=300) writes the figure to disk and must come before plt.show(), which clears the current figure.
Interpretation: a scatter rising left-to-right shows positive correlation, falling shows negative, no pattern shows none; a histogram shows shape (symmetric or skewed) and the modal class.
Database Query using SQL: DDL/DML, SELECT, WHERE, ORDER BY, aggregate functions, GROUP BY, HAVING, joins, and functions
DDL: CREATE TABLE, ALTER TABLE (ADD/MODIFY/DROP COLUMN), DROP TABLE, TRUNCATE TABLE. DML: INSERT INTO, UPDATE, DELETE. SELECT is DQL. DDL auto-commits; DML does not.
Clause order: SELECT [DISTINCT] columns FROM table WHERE row_condition GROUP BY cols HAVING group_condition ORDER BY col ASC|DESC LIMIT n.
WHERE operators: =, <, <=, >, >=, <>/!=, BETWEEN a AND b (inclusive), IN (v1,v2), LIKE with % (any characters) and _ (exactly one), IS NULL / IS NOT NULL, AND/OR/NOT.
Aggregates: COUNT(), COUNT(col) (skips NULL), SUM, AVG, MIN, MAX - all except COUNT() ignore NULL; aggregates may appear in SELECT and HAVING, never in WHERE.
GROUP BY makes one row per distinct combination; every non-aggregated SELECT column must appear in GROUP BY; HAVING filters groups after aggregation while WHERE filters rows before it.
Joins: t1 INNER JOIN t2 ON t1.k = t2.k keeps matching rows only; LEFT JOIN keeps all left rows, RIGHT JOIN all right rows, CROSS JOIN gives the Cartesian product; MySQL has no FULL OUTER JOIN.
String functions: UPPER(), LOWER(), LENGTH(), CONCAT(a,b), SUBSTR(s,pos,len), INSTR(s,sub), TRIM(), LEFT(), RIGHT(). Numeric: ROUND(x,d), ABS(x), MOD(a,b), POWER(x,y).
Date functions: CURDATE(), NOW(), YEAR(d), MONTH(d), DAY(d), DATEDIFF(d1,d2); compare DATE columns with 'YYYY-MM-DD' literals.
UPDATE t SET col=val WHERE cond (no WHERE updates every row); DELETE FROM t WHERE cond (no WHERE deletes all rows); PRIMARY KEY = UNIQUE + NOT NULL, FOREIGN KEY references another table's primary key.
Introduction to Computer Networks: types of networks, topologies, devices, protocols (TCP/IP, HTTP), and network security basics
Size order: PAN (about 10 m, Bluetooth), LAN (room/building/campus), MAN (city), WAN (countries/continents); the Internet is a network of networks.
Topologies: bus (one backbone, cheap, single point of failure), star (central switch/hub, easy fault isolation), ring (each node links to two neighbours), mesh needs n(n-1)/2 links, tree/hybrid combine shapes.
Devices: repeater and hub work at the physical layer (a hub broadcasts to all ports); switch works at the data-link layer using MAC addresses; router works at the network layer forwarding IP packets between networks; gateway connects dissimilar networks.
TCP is connection-oriented, reliable, ordered, with flow and error control; UDP is connectionless and unreliable but fast; IP handles addressing and routing without a connection.
Ports: HTTP 80, HTTPS 443, FTP 20/21, SMTP 25, POP3 110, IMAP 143, DNS 53, SSH 22, Telnet 23.
Addresses: IPv4 is 32-bit written as four dotted decimal octets; IPv6 is 128-bit; a MAC address is 48-bit written as six hex pairs.
Security basics: a firewall filters traffic by rules, antivirus scans for malware, encryption protects confidentiality, authentication verifies identity; threats include virus, worm, trojan, phishing, DoS and spyware.
Bandwidth is capacity (Hz or bps) while data transfer rate is the actual bits per second; a protocol is a set of rules for formatting and exchanging data between devices.
Societal Impacts of Informatics: digital footprints, cyber ethics, cybercrime, IPR, licensing, and e-waste
Digital footprint = the data trail left online; active footprints are created deliberately (posts, comments, forms), passive footprints are collected automatically (cookies, location, browsing logs); footprints are persistent and shareable.
Cyber ethics: no unauthorized access, no plagiarism, respect privacy, verify before sharing, no hate speech or harassment, follow netiquette in online communication.
Cybercrimes: hacking, phishing, identity theft, cyberstalking, cyberbullying, ransomware, credit-card fraud, software piracy, spreading obscene content.
India's Information Technology Act 2000 (amended 2008): s.66 hacking, s.66C identity theft, s.66D online fraud, s.66E privacy violation, s.67 obscene material in electronic form.
IPR types: copyright (literary/artistic works, author's life + 60 years in India), patent (invention, 20 years), trademark (brand name/logo, 10 years renewable), trade secret, geographical indication.
Licences: proprietary (paid, source closed), freeware (free to use, source closed), open source (source available, e.g. GPL, MIT, Apache), shareware (trial period), public domain (no rights reserved).
Piracy forms: softlifting (one licence used on many machines), hard-disk loading, client-server overuse, renting, counterfeiting, online/Internet piracy.
E-waste = discarded electronics; it contains lead, mercury, cadmium and brominated flame retardants; route it to authorized collection centres, apply reduce/reuse/recycle, and note that informal acid leaching harms soil and health.
Practical Work and Project: SQL queries on a database, Pandas-based data analysis, and a project report
Report order: title page, certificate, acknowledgement, index, introduction, problem/objectives, methodology, data collection, analysis with code and output, findings, conclusion, bibliography.
SQL practical sequence: CREATE TABLE with PRIMARY KEY/NOT NULL, INSERT rows, DESC table to verify, then SELECT queries with WHERE, ORDER BY, GROUP BY ... HAVING and one join; record each query with its output.
Pandas practical sequence: pd.read_csv, df.info()/shape, clean with dropna/fillna/drop_duplicates, groupby(...).agg(...) or merge, describe(), then a matplotlib plot; save results with to_csv().
Common SQL errors to check: unbalanced quotes, a missing comma between columns, a non-aggregated column absent from GROUP BY, an aggregate used in WHERE, and table/column name mismatch.
Frequent grouping pattern: df.groupby('dept')['salary'].mean() and df.groupby('dept').agg({'salary':'mean','age':'max'}); the grouping column becomes the index, so reset_index() flattens it.
Practical marking usually covers three parts: correct query/code, correct output, and a one-line interpretation stating what the result shows rather than just restating the numbers.
Tools to name in the report: Python 3 with Pandas and Matplotlib, MySQL (or another RDBMS) with a database created via CREATE DATABASE, and CSV files used as the data source.
Data sources to cite: supplied CSV files, survey/questionnaire responses, government open-data portals; document cleaning steps (missing values, duplicates, type conversion) under methodology.