//static //... ConcatenationWithCondition//... //{ // //... //} static void Main(string[] args) { List <Record> people = new List <Record>() { new Record("Keanu", "Reeves", "M", 25), new Record("Agent", "Smith", "M", 35), new Record("Carrie-Anne", "Moss", "F", 25), new Record("Gloria", "Foster", "M", 123), new Record("Belinda", "McClory", "F", 27) }; ListDataFrame ldf = new ListDataFrame(people); PrintDataFrame(ldf); Tuple <string, double> res = Mode(ldf); Console.WriteLine($"mode = {res.Item1}, percent = {res.Item2}"); FileDataFrame fdf = new FileDataFrame("dataFrame1.txt"); PrintDataFrame(fdf); Tuple <string, double> res2 = Mode(fdf); Console.WriteLine($"mode = {res2.Item1}, percent = {res2.Item2}"); //Console.WriteLine("\nConcatenation\n"); //Func<Record, bool> f = r => r.Gender == "F"; //PrintDataFrame(new ListDataFrame(ConcatenationWithCondition(ldf, fdf, f))); //FileDataFrame fdf2 = new FileDataFrame(ConcatenationWithCondition(ldf, fdf, f), "dataFrame2.txt"); }
public FileDataFrameIterator(FileDataFrame fdf) { string CombinedPath = Path.Combine(Directory.GetCurrentDirectory(), "../../" + fdf.filename); this.file = new StreamReader(Path.GetFullPath(CombinedPath)); }