Question: PLASE HELP , Write the codes according to the specified descriptions in quotation marks, ensuring originality and functionality. No rush, the most accurate response is

PLASE HELP , Write the codes according to the specified descriptions in quotation marks, ensuring originality and functionality. No rush, the most accurate response is needed
import numpy
import pandas
class InputError(Exception):
pass
def unique_agency_count(df: pandas.DataFrame)-> int:
""" This function returns the count of unique agency names in the DataFrame
"311-service-requests.csv" read with the file_read function.
Args:
df: Dataframe (pandas.DataFrame)
Returns:
result: int
"""
return NotImplementedError
def most_common_complaint_types(df: pandas.DataFrame, N: int)-> list:
""" This function returns a string list of the top N most common complaint types
from the DataFrame "311-service-requests.csv" read with the file_read function.
N can be between 1 and 165.
Args:
df: DataFrame to process (pandas.DataFrame)
N: Number of Repetitions (int)
Returns:
result: list
"""
return NotImplementedError
def file_read(file_path: str)-> pandas.DataFrame:
""" This function reads .csv or .tab files and returns the output as a Pandas DataFrame.
It is certain that the first row of these files will contain attribute names.
Args:
file_path (str): File path to be read with .csv or .tab extension
Returns:
result: pandas.DataFrame
"""
return NotImplementedError
def remove_duplicates(df: pandas.DataFrame)-> pandas.DataFrame:
""" This function removes rows of duplicate timestamps in a DataFrame with timestamps in its first column
(column name is not known) and keeps only the row of the most recent/newest timestamp in the DataFrame.
The input DataFrame remains unchanged when this function is executed.
Args:
df: DataFrame (pandas.DataFrame)
Returns:
result: DataFrame (pandas.DataFrame)
Example:
Shown in the visual.
"""
return NotImplementedError
def days_until_end_of_year(input_date: str)-> int:
""" This function returns the number of days left until the end of the year when a date in the format of "YYYY-MM-DD" is received.
The current day is not counted.
Args:
input_date: str
Returns:
result: int
Example:
input_date ="2022-12-29"
result =2
"""
return NotImplementedError
def my_max_pooling(matrix: numpy.array)-> numpy.array:
""" When a square matrix of size (N, N) with N being an even number is received as input,
this function creates a new square matrix of size (N/2, N/2) using the maximum number
in each (2,2) non-overlapping area.
Args:
matrix (numpy.array): Input array of size (N,N). N is a multiple of 4.
Returns:
result: numpy.array
Example:
Shown in the visual.
"""
return NotImplementedError
def find_problematic_boroughs(df: pandas.DataFrame)-> list:
""" This function returns the names of the top 5 boroughs with the highest number of illegal parking complaints
(Illegal Parking / Complaints) and their complaint counts as tuples from the DataFrame
"311-service-requests.csv" read with the file_read function.
Args:
df: Dataframe (pandas.DataFrame)
Returns:
result: list of tuples
Example:
[("BROOKLYN",1147),..]
"""
return NotImplementedError

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!