You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
in the distance_calculator.py file, we need a function that checks whether the university or study field of an incoming student matches with a local student. This will help assign a binary score for the match.
Function Details
Function Name: 'is_same_university'
Parameters:
incoming_student: A 'pd.Series` object representing the details of an incoming student.
local_student: A pd.Series object representing the details of a local student.
Returns:
A float (1.0 if there is a match, 0.0 if there isn't).
Instructions:
Create the is_same_university function in the 'distance_calculator.py' file.
Inside the function
Compare the university fields of incoming_student and local_student.
Compare the study_field fields of incoming_student and local_student.
If either field matches, return 1.0; otherwise, return 0.0.
Write clean, readable code, and add a docstring to the function.
desired function header:
defis_same_university(incoming_student: pd.Series, local_student: pd.Series) ->float:
""" Check if the university or study field matches between an incoming and a local student. Parameters: incoming_student (pd.Series): Details of the incoming student. local_student (pd.Series): Details of the local student. Returns: float: 1.0 if there's a match in university or study field, 0.0 otherwise. """# Your code here
The text was updated successfully, but these errors were encountered:
in the
distance_calculator.py
file, we need a function that checks whether the university or study field of an incoming student matches with a local student. This will help assign a binary score for the match.Function Details
Function Name: 'is_same_university'
Parameters:
pd.Series
object representing the details of a local student.Returns:
A float (1.0 if there is a match, 0.0 if there isn't).
Instructions:
Create the is_same_university function in the 'distance_calculator.py' file.
Inside the function
Compare the university fields of incoming_student and local_student.
Compare the study_field fields of incoming_student and local_student.
If either field matches, return 1.0; otherwise, return 0.0.
Write clean, readable code, and add a docstring to the function.
desired function header:
The text was updated successfully, but these errors were encountered: