- Define function with name
csv_to_dataframe
which should acceptfilepath
as a parameter. - Function should return a dataframe.
- As we require a dataframe, type of return variable should be pandas dataframe.
- In case if we pass
filepath
which does not exist, function should raise FileNotFoundError.
- Define function with name
merge_dataframe
which should acceptdataframe1
,dataframe2
(dataframes to be merged),column_name
(as string) as a parameter. - Function should return a dataframe.
- As we require a dataframe, type of return variable should be pandas dataframe.
- In case if we pass
column_name
which does not exist, function should raise KeyError.
- Define function with name
dtype_category
which should acceptdataframe
andlist of columns
as parameters. - Function should return a dataframe with type of given columns changed to "category".
- As we require a dataframe, type of return variable should be
pandas dataframe
. - In case if we pass column name which does not exist, function should raise KeyError
- Define function with name
categorical_variable_count
which should acceptdataframe
as parameter. - Function should return count of categorical variables.
- As we require count, type of return variable should be integer.
- In case if we pass dataframe which does not exist, function should raise NameError
Write a function to check variance of numeric columns of a dataframe, and if variance is lower than given threshold, drop the column
- Define function with name
var_check
which should acceptdataframe
,threshold
(int) as parameter. - Function should drop the the rejected columns and return a list of dropped variables.
- As we require list, type of return variable should be list.
- Define function with name
boxplot
which should acceptdataframe
,column_list
(of variables to be plotted) as parameters. - Function should return boxplots of numeric variables.
- As we require plot, type of return variable should be matplotlib object.
- In case if we pass column name which does not exist, function should raise KeyError