# NPTEL Python for Data Science Assignment 3 Answers 2022

NPTEL Python for Data Science Assignment 3 Answers:- Hello students in this article we are going to share NPTEL Python for Data Science assignment week 3 answers. All the Answers provided below to help the students as a reference, You must submit your assignment at your own knowledge.

Below you can find NPTEL Python for Data Science Assignment 3 Answers

### NPTEL Python for Data Science Assignment 3 Answers 2022:-

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`

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`

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:- a,b`

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`