Siksha Sarovar

Siksha Sarovar (sikshasarovar.com) is a free educational web application that helps students in India learn programming and prepare for academic and competitive exams. The platform offers structured coding courses (C, C++, Python, Java, HTML, CSS, PHP, Power BI, AI, Machine Learning, Data Science), complete university curriculum notes for BCA/MCA students with previous year question papers, Class 10 and Class 12 CBSE/HBSE school notes, and dedicated preparation material for SSC, UPSC, Banking, Railway and other government exams. Browsing the site is completely free and requires no account. Users may optionally sign in with Google solely to save their learning progress, quiz scores and personal preferences across devices.

Privacy Policy | Terms of Service | Contact Siksha Sarovar | About Siksha Sarovar

v4.0.9 · PWA
Siksha Sarovar logo
Siksha Sarovar
Your Learning Universe

Siksha Sarovar is a free e-learning platform for coding courses, BCA university notes and competitive exam preparation. Optional Google sign-in saves your learning progress across devices.

Initializing knowledge base…
Compiling modules 0%

Data Visualisation and Analytics Lab — Free Notes & Tutorial

Free DVA Lab practicals for BCA — visualization programs and analytics exercises at SikshaSarovar. Free DVA Lab course on SikshaSarovar.

This Data Visualisation and Analytics Lab course is part of Siksha Sarovar and is 100% free for students in India — no sign-up required to read. It contains 15 structured lessons with examples, and pairs with our free online compiler and AI tutor.

What you will learn

  • Visualization programs
  • Analytics lab exercises

Course content (15 lessons)

  1. Practical 1: DataFrame Selection with loc() and iloc() — Aim To create a pandas DataFrame containing e-commerce order data and perform row and column selection using the label-based indexer loc[] and the position-based indexer iloc[] .…
  2. Practical 2: Series Square and Filter — Aim To create a pandas Series object s5 containing numbers, compute the square of every element into a second Series s6 using vectorised arithmetic, and display only the squared…
  3. Practical 3: Fill Missing Values with Zero — Aim To locate missing values ( NaN ) in a student records DataFrame and replace them with zero using fillna(0) , while learning when zero-imputation is legitimate and when it…
  4. Practical 4: Combine DataFrames using concat(), join(), merge() — Aim To combine related DataFrames using the three pandas combination tools — concat() , join() and merge() — and to understand which tool answers which analytical question. CO…
  5. Practical 5: Bar Graph for CWG-2018 Medal Tally — Aim To draw a bar graph of India's CWG-2018 medal tally (Gold 26, Silver 20, Bronze 20, Total 66) with matplotlib and to read it using sound perceptual principles. CO Mapping:…
  6. Practical 6: Seaborn Line, Dist, Lm, and Count Plot — Aim To produce four seaborn statistical plots — line plot, distribution plot (histogram + KDE), regression plot ( lmplot ) and count plot — from one study-habits dataset, and to…
  7. Practical 7: NGO Aid DataFrame Filtering — Aim To create a DataFrame aid storing aid (toys, books, uniforms, shoes) sent by NGOs to different states, and to display (a) Books and Uniforms only and (b) Shoes only, using…
  8. Practical 8: Pivot - Projects by Position and City — Aim To create a DataFrame ndf with Name, Gender, Position, City, Age and Projects, and to summarise the total projects handled by each Position for each City using pd.pivot…
  9. Practical 9: Line Chart for 10 Unit Test Marks — Aim To store a student's marks in 10 unit tests in a list marks and plot them as a line chart with plt.plot() , using markers, axis labels and a grid so the trend across tests is…
  10. Practical 10: Horizontal Bar Chart for Heights — Aim To plot a horizontal bar chart of five students' heights using plt.barh() , with student names on the y-axis and height in centimetres on the x-axis. CO Mapping: CO1, CO2, CO3…
  11. Practical 11: One-Way ANOVA Implementation — Aim To implement one-way ANOVA (Analysis of Variance) manually with NumPy — computing the sums of squares (SS), degrees of freedom, mean squares (MS) and the F-statistic for three…
  12. Practical 12: Correlation Between Random Numbers — Aim To generate two related random number series with NumPy (Y built as roughly 0.7 × X plus noise), place them in a DataFrame, and measure their linear relationship with the…
  13. Practical 13: Covariance Implementation — Aim To implement covariance between two variables X and Y using np.cov() with ddof=1 (sample covariance), display the full 2 × 2 covariance matrix, and extract the covariance…
  14. Practical 14: GUI-Based Admission Form — Aim To create a GUI-based college admission form using tkinter — Labels and Entry widgets arranged with the grid() geometry manager and a Submit Button wired to a callback — that…
  15. Practical 15: GUI Form Connected to Database with Insert Query — Aim To connect the Practical 14 admission form to a database: on Submit the Name, Email and Course are inserted into an SQLite table via sqlite3 using a parameterised INSERT…

Practical 1: DataFrame Selection with loc() and iloc()

Aim

To create a pandas DataFrame containing e-commerce order data and perform row and column selection using the label-based indexer loc[] and the position-based indexer iloc[].

CO Mapping: CO1, CO2, CO3

Theory

A DataFrame is a two-dimensional, size-mutable, labelled data structure — conceptually a dictionary of Series that share a common row index. Every cell is therefore addressable in two independent ways:

  • loc[rows, cols] — label-based selection. Rows are chosen by their index labels and columns by their names. Slices are inclusive of both endpoints (loc[1:3] returns labels 1, 2 and 3), because labels have no natural "one past the end".
  • iloc[rows, cols] — integer-position selection. Rows and columns are chosen by 0-based positions, and slices follow normal Python half-open semantics (iloc[0:3] returns positions 0, 1, 2 only).

This distinction is the single most common source of off-by-one bugs in analytics code. It matters even more after operations such as sort_values(), dropna() or boolean filtering, which leave "holes" in the index: loc[5] then means the row labelled 5, wherever it now sits, while iloc[5] means the sixth physical row. Subsetting is the pandas equivalent of SQL's SELECT ... WHERE ... and is the first step of virtually every analysis, so fluency here pays off in every later practical.

Dataset

The student creates this 5-row order table (built in the snippet as the ecommerce DataFrame with a default RangeIndex 0–4):

IndexOrderIDCustomerCategorySales
0101AmanElectronics25000
1102RiyaBooks1200
2103KabirFashion3400
3104SnehaElectronics18000
4105VikasBooks800

Procedure

  1. Import pandas as pd.
  2. Build the ecommerce DataFrame from a column dictionary; pandas assigns the default integer index 0–4.
  3. Print the full DataFrame and confirm the index labels equal the positions (they coincide here, which is exactly why both indexers must be tested consciously).
  4. Run ecommerce.loc[1:3, ["OrderID", "Category", "Sales"]] — a label slice plus an explicit column list.
  5. Run ecommerce.iloc[0:3, 0:3] — a position slice on both axes.
  6. Count the rows returned by each call and note which endpoint was included.
  7. (Extension) Execute ecommerce.sort_values("Sales").loc[1:3] and the same with iloc to see the two indexers diverge once row order changes.

Interpretation of Results

loc[1:3] returns three rows (labels 1, 2, 3 → orders

Continue reading: Practical 1: DataFrame Selection with loc() and iloc() →

Frequently asked questions

Is the Data Visualisation and Analytics Lab course really free?

Yes. The entire Data Visualisation and Analytics Lab course on Siksha Sarovar is free to read with no account required. You can optionally sign in with Google to save your progress.

Do I get a certificate for Data Visualisation and Analytics Lab?

Yes — finish the lessons and pass the quiz to earn a free, verifiable certificate you can share on LinkedIn or with recruiters.

Can I run code while learning?

Yes. The built-in online compiler runs C, C++, Python, Java, PHP, JavaScript, C# and SQL directly in your browser — no installation needed.