Need help with this week’s assignment? Get detailed and trusted solutions for Data Science for Engineers Week 1 NPTEL Assignment Answers. Our expert-curated answers help you solve your assignments faster while deepening your conceptual clarity.
✅ Subject: Data Science for Engineers
📅 Week: 1
🎯 Session: NPTEL 2025 July-October
🔗 Course Link: Click Here
🔍 Reliability: Verified and expert-reviewed answers
📌 Trusted By: 5000+ Students
For complete and in-depth solutions to all weekly assignments, check out 👉 NPTEL Data Science for Engineers Week 1 NPTEL Assignment Answers
🚀 Stay ahead in your NPTEL journey with fresh, updated solutions every week!
Data Science for Engineers Week 1 NPTEL Assignment Answers 2025
1. Which of the following variable names are INVALID in R?
- 1_variable
- variable_1
- _variable
- variable@
Answer : For Answers Click Here
2. The function ls() in R will
- set a new working directory path
- list all objects in our working environment
- display the path to our working directory
- None of the above
Answer :
Consider the following code snippet. Based on this, answer questions 3 and 4.

3. Which of the following command is used to access the value “Shyam”?
- print(patient_list[3][2])
- print(patient_list[[3]][1])
- print(patient_list[[3]][2])
- print(patient_list[[2]][2])
Answer :
4. What does the following R code produce?

- “apple”
- “banana”
- “cherry”
- Error
Answer :
5. What is the output of following code?

- double
- integer
- list
- None of the above
Answer :
6. State whether the given statement is True or False.
The library reshape2 is based around two key functions named melt and cast.
- True
- False
Answer : For Answers Click Here
7. What does the following R code return?

- 5, 10, 15, 20
- 15, 20
- 10, 15, 20
- Error
Answer :
8. What is the output of the following R code?

- 1, 2, 3
- 0, 1, 2
- 1, 2, 3, 4
- Error
Answer :
9. Choose the correct command to add a column named student_dept to the dataframe student_data.
- student_datastudent_dept=c(“Commerce”, “Biology”, “English”, “Tamil”)
- student_data[“student_dept”]= c(“Commerce”,“Biology”, “English”,“Tamil”)
- student_dept= student_data[c(“Commerce”,“Biology”,“English”,“Tamil”)]
- None of the above
Answer :
10. Choose the correct command to access the element Tamil in the dataframe student_data.
- student_data[[4]]
- student_data[[4]][3]
- student_data[[3]][4]
- None of the above
Answer :
11. The command to check if a value is of numeric data type is __.
- typeof()
- is.numeric()
- as.numeric()
- None of the above
Answer :
12. What will the following R code return?

- 6
- 5
- 9
- Error
Answer :
13. What is the result of the following R code?

- [1] 8 10 12
[2] 14 16 18 - [1] [2] [3]
[1] 8 12 16
[2] 10 14 18 - [1] 8 9 10 11 12 13
- Error
Answer : For Answers Click Here
NPTEL Data Science for Engineers Week 1 Assignment Answers 2025
1. Which of the following variable names are INVALID in R?
a. 1_variable
b. variable_1
c. _variable
d. variable@
Answer: a. 1_variable, c. _variable, d. variable@
Explanation:
- Variable names in R cannot start with a digit →
1_variableis invalid. - Variable names should not start with an underscore →
_variableis invalid. - Special characters like
@are not allowed in variable names →variable@is invalid. variable_1is valid.
2. The function ls() in R will
a. set a new working directory path
b. list all objects in our working environment
c. display the path to our working directory
d. None of the above
Answer: b. list all objects in our working environment
Explanation:ls() is used to list all the variables and functions currently defined in the environment.
3. Which of the following command is used to access the value “Shyam”?
a. print(patient_list[3][2])
b. print(patient_list[[3]][1])
c. print(patient_list[[3]][2])
d. print(patient_list[[2]][2])
Answer: c. print(patient_list[[3]][2])
Explanation:
[[3]]accesses the third element of the list.[2]accesses the second element within that third list item, which is"Shyam".
4. The output of the code given below is
Code will throw an error
Answer: c.
Explanation:
(Without code, can’t give exact explanation. If you provide code, I can elaborate.)
5. What is the output of following code?
a. double
b. integer
c. list
d. None of the above
Answer: a. double
Explanation:
By default, R treats numeric literals (like 3.14 or 5) as double unless specifically defined as integer using L (e.g., 5L).
6. State whether the given statement is True or False.
“The library reshape2 is based around two key functions named melt and cast.”
a. True
b. False
Answer: a. True
Explanation:
The reshape2 package uses melt() to transform data into long format and cast() (or dcast()/acast()) to reshape it back.
7. What is the output of following code?
a. 6
b. 4
c. 2
d. 8
Answer: b. 4
Explanation:
(Explanation depends on code. Please share the exact code for better clarity.)
8. Choose the correct command to add a column named student_dept to the dataframe student_data.
a. student_data$student_dept = c("Commerce", "Biology", "English", "Tamil")
b. student_data["student_dept"]= c("Commerce", "Biology", "English", "Tamil")
c. student_dept= student_data[c("Commerce", "Biology", "English", "Tamil")]
d. None of the above
Answer: a and b
Explanation:
Both a and b correctly add a new column to the dataframe.
$adds a column by name.df["new_col"]adds it using the name as string.
9. Choose the correct command to access the element “Tamil” in the dataframe student_data.
a. student_data[[4]]
b. student_data[[4]][3]
c. student_data[[3]][4]
d. None of the above
Answer: c. student_data[[3]][4]
Explanation:
[[3]]accesses the third column.[4]accesses the fourth value in that column.
Hence,"Tamil"is correctly accessed this way.
10. The command to check if a value is of numeric data type is ____
a. typeof()
b. is.numeric()
c. as.numeric()
d. None of the above
Answer: b. is.numeric()
Explanation:
is.numeric()checks if the data is numeric (returns TRUE/FALSE).as.numeric()converts values to numeric type.typeof()returns the data type, not just a boolean check.


