# Path: dcs/clean.py
# def fillDown(df, columnFrom, columnTo, method):
# def fillByInterpolation(df, columnIndex, method, order):
# def fillWithCustomValue(df, columnIndex, newValue):
# def fillWithAverage(df, columnIndex, metric):
# def normalize(df, columnIndex, rangeFrom=0, rangeTo=1):
# def standardize(df, columnIndex):
# def deleteRowsWithNA(df, columnIndex):
# def findReplace(df, columnIndex, toReplace, replaceWith, matchRegex):
# def generateDummies(df, columnIndex, inplace):
# def insertDuplicateColumn(df, columnIndex):
# def splitColumn(df, columnIndex, delimiter, regex=False):
# def combineColumns(df, columnHeadings, seperator="", newName="merged_column", insertIndex=0):
# def discretize(df, columnIndex, cutMode, numberOfBins):
# def executeCommand(df, command):


import numpy as np
import pandas as pd
import pytest
from dcs import clean

#test replacing a value that dose not exist in a column (Numeric)
def test_find_replace3():
	testing_df = df.copy()
	result_df = df.copy()
	clean.findReplace(result_df, 0, [16], [32], False)
	result_df = result_df.astype(float)
	assert (((testing_df.fillna(0) == result_df.fillna(0)).all()).all()) == True

#test replacing a single type of value in a column (String)
def test_find_replace4():
	testing_df = df.copy()
	testing_df['col4'] = pd.Series(['hello', 'world', 'wild'], index = [0, 1, 2])
	result_df = testing_df.copy()
	clean.findReplace(result_df, 0, ['hello'], ['bello'], False)
	testing_df['col1'].replace(to_replace='hello', value='bello', regex=False, inplace=True)
	assert (((testing_df.fillna(0) == result_df.fillna(0)).all()).all()) == True

#test replacing a multiple values in a column (String)
def test_find_replace5():
	testing_df = df.copy()
	testing_df['col4'] = pd.Series(['hello', 'world', 'wild'], index = [0, 1, 2])
	result_df = testing_df.copy()
	clean.findReplace(result_df, 0, ['hello', 'wild', 'world'], ['bello', 'bello', 'bello'], False)
	testing_df['col1'].replace(to_replace='hello', value='bello', regex=False, inplace=True)
	testing_df['col1'].replace(to_replace='wild', value='bello', regex=False, inplace=True)
	testing_df['col1'].replace(to_replace='world', value='bello', regex=False, inplace=True)
	assert (((testing_df.fillna(0) == result_df.fillna(0)).all()).all()) == True

#test replacing all number values using regex in a column (Numeric)

# Path: dcs/clean.py
# def fillDown(df, columnFrom, columnTo, method):
# def fillByInterpolation(df, columnIndex, method, order):
# def fillWithCustomValue(df, columnIndex, newValue):
# def fillWithAverage(df, columnIndex, metric):
# def normalize(df, columnIndex, rangeFrom=0, rangeTo=1):
# def standardize(df, columnIndex):
# def deleteRowsWithNA(df, columnIndex):
# def findReplace(df, columnIndex, toReplace, replaceWith, matchRegex):
# def generateDummies(df, columnIndex, inplace):
# def insertDuplicateColumn(df, columnIndex):
# def splitColumn(df, columnIndex, delimiter, regex=False):
# def combineColumns(df, columnHeadings, seperator="", newName="merged_column", insertIndex=0):
# def discretize(df, columnIndex, cutMode, numberOfBins):
# def executeCommand(df, command):


# Path: dcs/testing/test_clean_module.py
import numpy as np
import pandas as pd
import pytest
from dcs import clean


#test replacing a value that dose not exist in a column (Numeric)
def test_find_replace3():
	testing_df = df.copy()
	result_df = df.copy()
	clean.findReplace(result_df, 0, [16], [32], False)
	result_df = result_df.astype(float)
	assert (((testing_df.fillna(0) == result_df.fillna(0)).all()).all()) == True

#test replacing a single type of value in a column (String)
def test_find_replace4():
	testing_df = df.copy()
	testing_df['col4'] = pd.Series(['hello', 'world', 'wild'], index = [0, 1, 2])
	result_df = testing_df.copy()
	clean.findReplace(result_df, 0, ['hello'], ['bello'], False)
	testing_df['col1'].replace(to_replace='hello', value='bello', regex=False, inplace=True)
	assert (((testing_df.fillna(0) == result_df.fillna(0)).all()).all()) == True

#test replacing a multiple values in a column (String)
def test_find_replace5():
	testing_df = df.copy()
	testing_df['col4'] = pd.Series(['hello', 'world', 'wild'], index = [0, 1, 2])
	result_df = testing_df.copy()
	clean.findReplace(result_df, 0, ['hello', 'wild', 'world'], ['bello', 'bello', 'bello'], False)
	testing_df['col1'].replace(to_replace='hello', value='bello', regex=False, inplace=True)
	testing_df['col1'].replace(to_replace='wild', value='bello', regex=False, inplace=True)
	testing_df['col1'].replace(to_replace='world', value='bello', regex=False, inplace=True)
	assert (((testing_df.fillna(0) == result_df.fillna(0)).all()).all()) == True

#test replacing all number values using regex in a column (Numeric)

def test_find_replace6():