NPTEL Python for Data Science Assignment 3 Answers 2023

NPTEL Python for Data Science Assignment 3 Answers 2023:- All the Answers provided below to help the students as a reference, You must submit your assignment at your own knowledge.

NPTEL Python For Data Science Week 3 Assignment Answer 2023

1. Which of the following is the correct approach to fill missing values in case of categorical variable?

  • Mean
  • Median
  • Mode
  • None of the above
Answer :- 

2. Of the following set of statements, which of them can be used to extract the column Type as a separate dataframe?

  • df_cars[[‘Type’]]
  • df_cars.iloc[[:, 1]
  • df_cars.loc[:, [‘Type’]]
  • None of the above
Answer :- For Answer Click Here

3. The method df_cars.describe() will give description of which of the following column?

  • Car name
  • Brand
  • Price (in lakhs)
  • All of the above
Answer :- 

4. Which pandas function is used to stack the dataframes vertically?

  • pd.merge()
  • pd.concat()
  • join()
  • None of the above
Answer :- 

5. Which of the following are libraries in Python?

  • Pandas
  • Matplotlib
  • NumPy
  • All of the above
Answer :- For Answer Click Here

6. Which of the following variable have null values?

  • ID
  • Company
  • Review Date
  • Rating
Answer :- 

7. Which of the following countries have maximum locations of cocoa manufacturing companies?

  • U.K.
  • U.S.A.
  • Canada
  • France
Answer :- For Answer Click Here

8. After checking the data summary, which feature requires a data conversion considering the data values held?

  • Rating
  • Review date
  • Company
  • Bean origin
Answer :- 

9. What is the maximum rating of chocolates?

  • 1.00
  • 5.00
  • 3.18
  • 4.00
Answer :- 

10. What will be the output of the following code?
NPTEL Python for Data Science Assignment 3 Answers 2023

  • [bool, int, float, float, str]
  • [str, int, float, float, str]
  • [bool, int, float, int, str]
  • [bool, int, int, float, str]
Answer :- For Answer Click Here

NPTEL Python for Data Science Assignment 3 Answers 2022 [July-Dec]

1. Choose the appropriate command(s) to filter those booking details whose reservation_status are a No-show?

a. data_hotel_ns datahotel. loc[data_hotel.reservation_status=’No-Show’]
b. data_hotel_ns = data_hotel[ data _hotel.reservation_status = “No-Show’]
c. data hotel_ns = data_hotel.reservation_status.loc[data_hotel.isin([‘No-Show’])]
d. data_hotel_ns = data_hotel.loc [data hotel.reservation_status.isin([ No-Show’])]

Answer:- b, d

2. From the same data, find how many bookings were not canceled in the year 2017?

a. 9064
b. 6231
c. 9046
d. None of the above

Answer:- a

Answers will be Uploaded Shortly and it will be Notified on Telegram, So JOIN NOW

NPTEL Python for Data Science Assignment 3 Answers 2023

3. From the total bookings that were made in 2017 and not canceled, which month had the highest number of repeated guests?

a. July
b. February
c. January
d. None of the above

Answer:- c

4. Which of the following commands can be used to create a variable Flag, and set the values as Premium when the rating is equal to or greater than 3.25, and otherwise as Regular?

a. dt_cocoa[°Flag’] = [“Premium” if x 3.25 else “Regular” for x in dt_cocoa[‘Rating’ ]]
b. dt_cocoa[“Flag’] = [“Premium” if x 3.25 else “Regular” for x in dt_cocoa[ Rating ‘]]
c. dt_cocoa[“Flag”] = np.where(dt_cocoa[ “Rating”] < 3.25, “Regular”, “Premium”)
d. None of the above

Answer:- b, c

5. Which instruction can be used to impute the missing values in the column Review Data from the dataframe dt_cocoa by grouping the records company–wise?

Answer:- a

6. After checking the data summary, which feature requires a data conversion considering the data values held?

a. Rating
b. Review Date
c. Company
d. None of the above

Answer:- b

👇For Week 04 Assignment Answers👇

NPTEL Python for Data Science Assignment 3 Answers 2023

7. What is the maximum average rating for the cocoa companies based out of Guatemala?

a. 4
b. 3.5
c. 3.42
d. None of the above

Answer:- c

8. Which pandas function is used to stack the dataframes vertically?

a. pd.merge()
b. pd.concat()
c. join()
d. None of the above

Answer:- b

9. Of the following set of statements, which of them can be used to extract the column Direction as a separate dataframe?

a. df_weather[[Direction ‘ ]]
b. df_weather.iloc[:,0]
c. df_weather.loc[:.[ ‘Direction ‘]]
d. None of the above

Answer:- Click Here

10. Which one of these students’ average score across all subjects was the lowest? Which subject has the highest average score across students?

a. Harini, Maths
b. Sathi, Maths
c. Harini, Physics
d. Rekha, Maths

Answer:- b

For More NPTEL Answers:- CLICK HERE

Join Our Telegram:- CLICK HERE

About Python For Data Science

The course aims at equipping participants to be able to use python programming for solving data science problems.

CRITERIA TO GET A CERTIFICATE

Average assignment score = 25% of average of best 3 assignments out of the total 4 assignments given in the course.
Exam score = 75% of the proctored certification exam score out of 100

Final score = Average assignment score + Exam score

YOU WILL BE ELIGIBLE FOR A CERTIFICATE ONLY IF AVERAGE ASSIGNMENT SCORE >=10/25 AND EXAM SCORE >= 30/75. If one of the 2 criteria is not met, you will not get the certificate even if the Final score >= 40/100.

NPTEL Python for Data Science Assignment 3 Answers [Jan 2022]

Q1. Data from the file “brand_data.csv“ has to be loaded into a pandas dataframe. A snippet of the data is shown below:

NPTEL Python for Data Science Assignment 3 Answers 2023

What is the right instruction to read the file into a dataframe df_brand with 4 separate columns?

Answer:- (B), (C) & (D)

👇FOR NEXT WEEK ASSIGNMENT ANSWERS👇

NPTEL Python for Data Science Assignment 3 Answers 2023

Q2. For the same file above “brand_data.csv“, which parameter in pd.read_csv will help to load dataframe df_brand with the selected columns as shown below?

NPTEL Python for Data Science Assignment 3 Answers 2023

(A) index_col 
(B) skiprows 
(C) usecols 
(D) None of the above

Answer:- (C) usecols 

Q3. Data from the file “weather.xlsx“ has to be loaded into a pandas dataframe df_weather which when printed is as shown below:

NPTEL Python for Data Science Assignment 3 Answers 2023

Of the following set of statements which of them can be used to move the column “Direction” into a separate dataframe

Answer:- (A), (B), (C) & (D)

Q4. Referring to the same dataframe df_weather in Question (3), which statement/statements will help to print the last row from the dataframe?

Answer:- (B) & (D)

Q5. In reference to the same dataframe df_weather, we add an additional column ‘Hot_day’ to determine whether the day is hot or not based on the values in the Temperature column. What will the print statement derive?

NPTEL Python for Data Science Assignment 3 Answers 2023

(A) True 
(B) SyntaxError 
(C) False 
(D) None of the above

👇FOR NEXT WEEK ASSIGNMENT ANSWERS👇

NPTEL Python for Data Science Assignment 3 Answers 2023

Answer:- (C) False 

Q6. What statement would give the number of columns in a dataframe df?

(A) len(df.columns) 
(B) len(df) 
(C) df.size 
(D) All of the above

Answer:- (A) len(df.columns) 

Q7. A file “Students.csv” contains the attendance and total scores of three separate students. This data is loaded into a dataframe df_study and a pandas crosstab is applied on the same dataframe which results in the following output

NPTEL Python for Data Science Assignment 3 Answers 2023

Which student scored the maximum average score of all three subjects? Which subject has the best average score for all three students?

(A) Harini,Chemistry 
(B) Rekha,Physics 
(C) Harini,Physics 
(D) Rekha,Maths

Answer:- (D) Rekha,Maths

Q8. The following histogram shows the number of books read in a year:

NPTEL Python for Data Science Assignment 3 Answers 2023

Find the mean and median in the above histogram.

(A) 7,8 
(B) 8,9 
(C) 8.5,7 
(D) 8,8 
(E) None of the above

Answer:- (D) 8,8 

Q9. For the following box plot, which among the given options are the median and the outlier?

NPTEL Python for Data Science Assignment 3 Answers 2023

(A) 15, 52 
(B) 22, 52 
(C) 13.5, 29 
(D) 25, 50

Answer:- (B) 22, 52 

Q10. A dataframe df_logs has the following data.

NPTEL Python for Data Science Assignment 3 Answers 2023

All the NaN / Null values in the column C1 can be replaced by zero value by executing which of the following statements?

(A) df_logs[‘C1’].fillna(0,inplace = True) 
(B) df_logs.fillna(0,inplace = True) 
(C) df_logs.fillna(0,inplace = False) 
(D) df_logs[‘C1’].fillna(df_logs[‘B1’],inplace = True)

Answer:- (A) df_logs[‘C1’].fillna(0,inplace = True) 

👇FOR NEXT WEEK ASSIGNMENT ANSWERS👇

NPTEL Python for Data Science Assignment 3 Answers 2023

Disclaimer:- We do not claim 100% surety of solutions, these solutions are based on our sole expertise, and by using posting these answers we are simply looking to help students as a reference, so we urge do your assignment on your own.

For More NPTEL Answers:- CLICK HERE

Join Our Telegram:- CLICK HERE

NPTEL Python for Data Science Assignment 3 Answers 2022:- All the Answers provided below to help the students as a reference, You must submit your assignment at your own knowledge.

Leave a Comment