Pandas Sample Student DataFrame: 35-Row Test Dataset

The 35-row student dataset is the benchmark table used throughout plus2net tutorials for demonstration, code testing, and practice exercises. It provides a balanced mix of numeric scores, categorical groupings, and string identifiers. You can download the dataset in any standard format (Excel, CSV, JSON, HTML, or XML) or instantiate it directly in memory using the copy-paste Python dictionary below.

Dataset Schema & Variable Definitions 🔝

The student table contains 35 rows and 5 columns structured as follows:

Column NameData TypeDescriptionSample Values
idInteger (int64)Unique sequential student identifier (Primary Key / Index).1, 2, 3, …, 35
nameString (object)Full name of the student.'John Deo', 'Max Ruin', 'Jane'
class1String (object)Categorical class or grade level.'Three', 'Four', 'Five', 'Six', 'Seven', 'Eight', 'Nine'
markInteger (int64)Numerical examination test score (0–100).75, 85, 55, 94
genderString (object)Gender classification ('female', 'male').'female', 'male'

Direct File Downloads 🔝

Download the dataset in your preferred format to test local ingestion routines:

Instant Creation via Python Dictionary 🔝

To start coding immediately without downloading external files, copy this self-contained dictionary snippet into your script or notebook:

import pandas as pd

student_data = {
    "id": list(range(1, 36)),
    "name": [
        "John Deo", "Max Ruin", "Arnold", "Krish Star", "John Mike",
        "Alex John", "My John Rob", "Asruid", "Tes Qry", "Big John",
        "Ronald", "Recky", "Kty", "Bigy", "Tade Row", "Gimmy",
        "Tumyu", "Honny", "Tinny", "Jackly", "Babby John", "Reggid",
        "Herod", "Tiddy Now", "Giff Tow", "Crelea", "Big Nose",
        "RorFail", "Duke", "Dean", "Eack", "Blake", "David",
        "Ram", "Jane"
    ],
    "class1": [
        "Four", "Three", "Three", "Four", "Four",
        "Four", "Five", "Five", "Six", "Four",
        "Six", "Six", "Seven", "Seven", "Four",
        "Four", "Six", "Five", "Nine", "Nine",
        "Four", "Seven", "Eight", "Seven", "Seven",
        "Seven", "Three", "Five", "Six", "Five",
        "Six", "Four", "Eight", "Three", "Four"
    ],
    "mark": [
        75, 85, 55, 60, 60,
        55, 78, 85, 78, 55,
        89, 94, 88, 88, 88,
        88, 54, 75, 18, 65,
        69, 55, 79, 78, 88,
        79, 81, 59, 55, 74,
        65, 88, 89, 78, 85
    ],
    "gender": [
        "female", "male", "male", "female", "female",
        "male", "male", "male", "male", "female",
        "female", "female", "female", "female", "male",
        "male", "male", "male", "male", "female",
        "female", "female", "male", "male", "male",
        "male", "female", "male", "female", "female",
        "female", "female", "female", "male", "female"
    ]
}
df_student = pd.DataFrame(student_data)
print(df_student.head(5))

Expected console output:

   id        name class1  mark  gender
0   1    John Deo   Four    75  female
1   2    Max Ruin  Three    85    male
2   3      Arnold  Three    55    male
3   4  Krish Star   Four    60  female
4   5   John Mike   Four    60  female

Loading from Each Storage Format 🔝

Test reading the downloaded student files using standard Pandas functions:

# 1. From Excel
df_excel = pd.read_excel("student.xlsx", index_col="id")

# 2. From CSV
df_csv = pd.read_csv("student.csv", index_col="id")

# 3. From JSON
df_json = pd.read_json("student.json")

# 4. From HTML Table
df_html = pd.read_html("student.html")[0]

# 5. From XML
df_xml = pd.read_xml("student.xml")

Statistical Verification & Quick Summary 🔝

Verify that your loaded DataFrame matches the benchmark characteristics:

assert len(df_student) == 35
assert df_student["mark"].mean() == 73.0

print("Total Students:", len(df_student))
print("Average Mark:", df_student["mark"].mean())
print("Gender Breakdown:\n", df_student["gender"].value_counts())

Expected console output:

Total Students: 35
Average Mark: 73.0
Gender Breakdown:
 gender
female    18
male      17
Name: count, dtype: int64

Exercise: filtering and exporting honor roll students 🔝

Perform these data wrangling and I/O tasks on the student DataFrame:

  1. Filter for honor roll students having a mark >= 80.
  2. Assert that exactly 13 students qualify.
  3. Sort the qualifying students in descending order of mark.
  4. Export the filtered list to a clean CSV string without index numbers (to_csv(index=False)).

Exercise solution 🔝

# Filter marks >= 80 and sort descending
honor_roll = df_student[df_student["mark"] >= 80].sort_values(by="mark", ascending=False)
print(f"Honor Roll Count: {len(honor_roll)}")

assert len(honor_roll) == 13
assert honor_roll["mark"].min() >= 80

csv_export = honor_roll.to_csv(index=False)
print("Top 3 Honor Students:\n", honor_roll[["name", "class1", "mark"]].head(3))

Expected console output:

Honor Roll Count: 13
Top 3 Honor Students:
       name class1  mark
11   Recky    Six    94
10  Ronald    Six    89
32   David  Eight    89

Practice in Google Colab 🔝

Open in Google Colab View on GitHub
Run all student dataset ingestion, manipulation, and filtering examples directly in Google Colab. All data is embedded in the notebook.

Reference: Pandas DataFrame constructor official documentation.




Subscribe to our YouTube Channel here



plus2net.com







Python Video Tutorials
Python SQLite Video Tutorials
Python MySQL Video Tutorials
Python Tkinter Video Tutorials
✖
We use cookies to improve your browsing experience. . Learn more
HTML MySQL PHP JavaScript ASP Photoshop Articles Contact us
© 2000-2026 plus2net.com All rights reserved worldwide Privacy Policy Disclaimer