Screen Link: Learn data science with Python and R projects
Hello guys,I am stuck here and will need help to get going.
My Code:
```for row in moma:
date = [6]
if date != "":
date = int(date)
row[6] = date
# Calculating Artist ages
ages = [0]
for row in moma:
birth = row[3]
date = row[6]
if type(birth) == int:
age = date - birth
else:
age = 0
ages.append(age)
final_ages = []
for age in ages:
if age > 20:
final_age = age
else:
final_age = "Unknown"
final_ages.append(final_age)
What I expected to happen:
i expected the code to run and submit successfully
what exactly happened:
an error occurred
Replace this line with the output/error
<ipython-input-1-46df82ca44f7> in <module>
48 date = [6]
49 if date != "":
---> 50 date = int(date)
51 row[6] = date
52
TypeError: int() argument must be a string, a bytes-like object or a number, not 'list'
Variables
<!--Enter other details below: -->
how does one solve this? Also, i manually typed the code on the scrip py page because the page did not reference code from Artworks_clean.csv file. for me to calculate the artist ages with/ Thanks for your time.