     {
         startrow = 1
     }
-    let test = y[completeDataRow + startrow - 1].componentsSeparatedByString(",") //Use first row to detect which columns are categorical
+    let test = y[rowWithoutMissingValues + startrow - 1].componentsSeparatedByString(",") //Use first row to detect which columns are categorical
     categorical_col = Array(count:test.count, repeatedValue:-1)
     columns=0
     for testtext in test{

    }
}

func read_csv(filename:String, _ skip_header:Bool=true, _ completeDataRow: Int=1) -> csvFile{
    var x: String?
    do {
        x = try String(contentsOfFile: filename, encoding: NSUTF8StringEncoding)

    var done = zeros((rows-startrow, columns))
    done.flat.grid = array
    if (skip_header==true){
    return CSVFile(data: done, header: y[0].componentsSeparatedByString(","))
    }
    else{
         return CSVFile(data: done, header: [""])
    }
}

