this code doesn't run as expected in Python3 when I do my data-analysing practice.
The typeerror is "TypeError: unsupported operand type(s) for /: 'dict_values' and 'int'".
How should I solve it?
import numpy as np
# Summarize the data about minutes spent in the classroom
total_minutes = total_minutes_by_account.values()
total_minutes = np.array(total_minutes)
print('Mean:', np.mean(total_minutes))
print('Standard deviation:', np.std(total_minutes))
print('Minimum:', np.min(total_minutes))
print('Maximum:', np.max(total_minutes))
dict.values
returns adict_values
object, which is not alist
ortuple
. Try coercing that into a list.total_minutes = list(total_minutes_by_account.values())
.