# 1.2 Assignment

course: Academy — 65-GENAI-for-Engineers
module: Academy/65-GENAI-for-Engineers
type: pdf
source_url: https://personal-learn.armco.dev/files/Academy/65-GENAI-for-Engineers/assignments/1.2_Assignment__CSV_and_JSON_Formats/1.2_Assignment.pdf
pages: 1

---
[page 1]
1.2 Assignment Questions 
 Short Answer / Conceptual Questions 
 1.  Explain the difference between CSV and JSON formats in terms of structure and typical 
 use cases. 
 2.  What type of data is better suited for JSON format rather than CSV? Give an example. 
 3.  What are the advantages of using CSV files for data analysis tasks? 
 Hands-On / Practical Tasks 
 4.  Create a CSV file that stores a simple table of products with fields: ProductID, 
 ProductName, Category, and Price. Then write a Python script using Pandas to: 
 a. Load the CSV 
 b. Display the first 3 rows 
 c. Show data types of each column 
 5.  Create a JSON file that contains nested customer order data, such as: 
 { 
 "CustomerID": 1, 
 "Name": "Ravi", 
 "Orders": [ 
 { 
 "OrderID": 101, 
 "Amount": 4500 
 }, 
 { 
 "OrderID": 102, 
 "Amount": 3000 
 } 
 ] 
 } 
 Now write a Python script to: 
 a. Load the JSON 
 b. Access the customer’s name 
 c. Print total number of orders 
 6.  Convert a given CSV file to JSON format using Python. Ensure nested structures are 
 handled manually if needed (for example, grouping orders per customer).