Data Science, filter_col_by_float

29 minutes ago by Andrew Winkler 30,319 can someone explain the variables of this function that we’re supposed to use? It’s much different than the ones that are featured in the videos or standard python libraries. I’m just not getting it. filterByFloat.py from loadData import * data_from_csv = open_with_csv(‘data.csv’) solid_ties = filter_col_by_string(data_from_csv, “print”, “_solid”) def filter_col_by_float(data_sample, field, direction, filter_condition): filtered_rows = [] col = int(data_sample[0].index(field)) cond = float(filter_condition) for row in data_sample[1:]: element = float(row[col]) if direction == “<“: if element < cond: filtered_rows.append(row) elif direction == “<=”: if element <= cond: filtered_rows.append(row) elif direction == “>”: if element > cond: filtered_rows.append(row) elif direction == “>=”: if element >= cond: filtered_rows.append(row) elif direction == “==”: if element == cond: filtered_rows.append(row) else: pass return filtered_rows def filter_col_by_float(data_from_csv, solid_ties, solid35, price<35.00) #I…


Link to Full Article: Data Science, filter_col_by_float