def filter_data(dataframe, min_read_coverage, min_cpg_count):
	"""
	Inputs:
	1. dataframe, a pandas dataframe
	2. min_read_coverage, integer, the number of overlapping reads required to keep the bin
	3. min_cpg_count, integer, the number of CpGs in a bin required to keep it

	Output:
	1. A filtered data frame
	"""

	# Filter bins by number of reads and CpG counts
	# df_filtered = dataframe[dataframe["CpG Count"]>= min_cpg_count]
	df_filtered = dataframe[dataframe["Average Methylation Values"].apply(len) >= min_read_coverage]
	return df_filtered