Get the single-detector \chi^2 for each row in the table.
776960
def get_sngl_chisqs(self, instruments=None):
		
		if len(self) and instruments is None:
			instruments = map(str, \
			                instrument_set_from_ifos(self[0].ifos))
		elif instruments is None:
			instruments = []
		return dict((ifo, self.get_sngl_chisq(ifo))\
		            for ifo in instruments)
133081
def get_mean(self, col, row):
        
        return javabridge.call(self.jobject, "getMean", "(II)D", col, row)
556174
def getRowCurrentIndex(self):
        
        curIndex = self.currentIndex()
        col0Index = curIndex.sibling(curIndex.row(), 0)
        return col0Index
602899
public static Object[] getAt(TableModel self, int index) {
        int cols = self.getColumnCount();
        Object[] rowData = new Object[cols];
        for (int col = 0; col < cols; col++) {
            rowData[col] = self.getValueAt(index, col);
        }
        return rowData;
    }
483460
def get_column(self, X, column):
        
        if isinstance(X, pd.DataFrame):
            return X[column].values

        return X[:, column]
766021
def _pairwise_chisq(self):
        
        return self._chi_squared(self._proportions, self._margin, self._observed)
104993
def chi_p_from_xi1_xi2(xi1, xi2):
    
    xi1, xi2, input_is_array = ensurearray(xi1, xi2)
    chi_p = copy.copy(xi1)
    mask = xi1 < xi2
    chi_p[mask] = xi2[mask]
    return formatreturn(chi_p, input_is_array)
1229310
def __find_smallest(self):
        """"""
        minval = sys.maxsize
        for i in range(self.n):
            for j in range(self.n):
                if (not self.row_covered[i]) and (not self.col_covered[j]):
                    if minval > self.C[i][j]:
                        minval = self.C[i][j]
        return minval
791140
function findIdx(table, val) {
    if (table[0] > val)
        return -1;

    var l = 0, r = table.length;
    while (l < r-1) { // always table[l] <= val < table[r]
        var mid = l + Math.floor((r-l+1)/2);
        if (table[mid] <= val)
            l = mid;
        else
            r = mid;
    }
    return l;
}
964776
def getcellslice(self, rownr, blc, trc, inc=[]):
        """"""
        return self._table.getcellslice(self._column, rownr, blc, trc, inc)
1176573
def _vector(x, type='row'):
    """"""
    if isinstance(x, (list, tuple)):
        x = np.array(x, dtype=np.float32)
    elif not isinstance(x, np.ndarray):
        x = np.array([x], dtype=np.float32)
    assert x.ndim == 1
    if type == 'column':
        x = x[:, None]
    return x
343874
def bias(self):
        
        return (self.table[0, 0] + self.table[0, 1]) / (self.table[0, 0] + self.table[1, 0])
813343
public static double getPvalue(DataTable2D dataTable) {
        if(dataTable.isValid()==false) {
            throw new IllegalArgumentException("The provided Table does not have a rectangular format.");
        }

        //Estimate marginal scores and sum
        Map<Object, Double> XdotJ = new HashMap<>();
        Map<Object, Double> XIdot = new HashMap<>();
        double Xdotdot=0.0;

        for(Map.Entry<Object, AssociativeArray> entry1 : dataTable.entrySet()) {
            Object i = entry1.getKey();
            AssociativeArray row = entry1.getValue();
            
            for(Map.Entry<Object, Object> entry2 : row.entrySet()) {
                Object j = entry2.getKey();
                
                double v = TypeInference.toDouble(entry2.getValue());
                
                //Summing the columns
                if(XdotJ.containsKey(j)==false) {
                    XdotJ.put(j, v);
                }
                else {
                    XdotJ.put(j, XdotJ.get(j) + v);
                }

                //Summing the rows
                if(XIdot.containsKey(i)==false) {
                    XIdot.put(i, v);
                }
                else {
                    XIdot.put(i, XIdot.get(i) + v);
                }
                
                Xdotdot+=v;
            }
        }

        int k=XdotJ.size();
        int n=XIdot.size();

        //Calculating Qscore        
        double SumOfSquaredXdotJ=0.0;
        for(Double value : XdotJ.values()) {
            SumOfSquaredXdotJ+=value*value;
        }
        //XdotJ=null;

        double SumOfSquaredXIdot=0;
        double SumOfXIdot=0;
        for(Double value : XIdot.values()) {
            SumOfSquaredXIdot+=value*value;
            SumOfXIdot+=value;
        }
        //XIdot=null;

        double Qscore=(k-1.0)*(k*SumOfSquaredXdotJ-Xdotdot*Xdotdot)/(k*SumOfXIdot-SumOfSquaredXIdot);

        double pvalue = scoreToPvalue(Qscore, n, k);

        return pvalue;
    }
541639
def count(self, table):
        
        if self._operator is None and self._operands is None:
            return self._get_table_len(table)

        return np.count_nonzero(self.mask(table))
301685
function(table) {
    var rows = 0;
    var columns = 0;
    var trs = table.getElementsByTagName("tr");
    for (var i = 0; i < trs.length; i++) {
      var rowspan = trs[i].getAttribute("rowspan") || 0;
      if (rowspan) {
        rowspan = parseInt(rowspan, 10);
      }
      rows += (rowspan || 1);

      // Now look for column-related info
      var columnsInThisRow = 0;
      var cells = trs[i].getElementsByTagName("td");
      for (var j = 0; j < cells.length; j++) {
        var colspan = cells[j].getAttribute("colspan") || 0;
        if (colspan) {
          colspan = parseInt(colspan, 10);
        }
        columnsInThisRow += (colspan || 1);
      }
      columns = Math.max(columns, columnsInThisRow);
    }
    return {rows: rows, columns: columns};
  }
277282
private void getColumnBoundaryWithoutHeading(TableCandidate tc) {
    	int heads = tc.getHeadingLineNumber() +1;
    	int MAXcolumnNum = tc.getMaxColumnNumber();
    	int footnoteLineIndex = tc.getFootnoteBeginRow();
    	TableRow row;
    	if(MAXcolumnNum==0) return;
    	
    	float[] leftX_tableColumns = new float[MAXcolumnNum*4];
		float[] rightX_tableColumns = new float[MAXcolumnNum*4];
		for (int qq=0; qq<MAXcolumnNum*4; qq++) {
			leftX_tableColumns[qq]=1000.0f;
			rightX_tableColumns[qq] = 0.0f; 
		}
		int cc=1;
		
		boolean fullRowExists = false;
		int maxTextPieceInTableContent = 0;
		/*
		 * Checks whether there is a data line that has the max number of the text pieces
		 */
		for (int pp=heads; pp<footnoteLineIndex; pp++) {
			row = tc.getRows().get(pp);
			if (maxTextPieceInTableContent<row.getCells().size())
					maxTextPieceInTableContent = row.getCells().size();
		}
		if (maxTextPieceInTableContent==MAXcolumnNum) fullRowExists=true;
		/*
		 * Adjusts leftX_tableColumns and rightX_tableColumns based on the cells
		 */
		for (int pp=heads; pp<footnoteLineIndex; pp++) {
			row = tc.getRows().get(pp);
			if (pp==heads) {
				leftX_tableColumns[0]= row.getCells().get(0).getX(); 		//pmoj.cmdX_thisTable[heads][0];
				rightX_tableColumns[0] = row.getCells().get(0).getEndX();  //rightX_tableColumns[0]=pmoj.cmdEndX_thisTable[heads][0];
			}
			
			if( ((fullRowExists==true) && (row.getCells().size() == MAXcolumnNum)) || (fullRowExists == false)){
				/*
				 * Each text piece/cell in a row
				 */
				for (int qq=0; qq< row.getCells().size(); qq++) {
					/*
					 * Gets a new leftmost column
					 */
					if ( ((leftX_tableColumns[0]- row.getCells().get(qq).getEndX())>m_docInfo.getAverageXGap()*2.0) 
					&&  (row.getCells().get(qq).getEndX()>0.0f) ){
						for (int ii=cc; ii>0; ii--) {
							leftX_tableColumns[ii] = leftX_tableColumns[ii-1];
							rightX_tableColumns[ii] = rightX_tableColumns[ii-1];
						}
						leftX_tableColumns[0]=row.getCells().get(qq).getX();
						rightX_tableColumns[0]=row.getCells().get(qq).getEndX();
						cc++;
					}
					else {
						/*
						 * Gets a new rightmost column
						 */
						if ( ( (row.getCells().get(qq).getX()-rightX_tableColumns[cc-1])>m_docInfo.getAverageXGap()*2.0) 
						&& (row.getCells().get(qq).getX()<1000.0f) ){
							leftX_tableColumns[cc]=row.getCells().get(qq).getX();
							rightX_tableColumns[cc]=row.getCells().get(qq).getEndX();
							cc++;
						}
						/*
						 * A new column 
						 */
						else {
							int thisC = 1;
							boolean newMidColumn = false;
							while (thisC<cc) {
								if ( ((row.getCells().get(qq).getX()-rightX_tableColumns[thisC-1])>m_docInfo.getAverageXGap()*2.0) 
								&& ((leftX_tableColumns[thisC]-row.getCells().get(qq).getEndX())>m_docInfo.getAverageXGap() * 2.0) 
								&& (row.getCells().get(qq).getX()<1000.0f) && (row.getCells().get(qq).getEndX()>0.0f)) {
									for (int ii=cc; ii>thisC; ii--) {
										leftX_tableColumns[ii] = leftX_tableColumns[ii-1];
										rightX_tableColumns[ii] = rightX_tableColumns[ii-1];
									}
									cc++;
									leftX_tableColumns[thisC]=row.getCells().get(qq).getX();
									rightX_tableColumns[thisC]=row.getCells().get(qq).getEndX();
									newMidColumn=true;
									break;
								}
								thisC++;
							}
							if (newMidColumn==false) {
								thisC = 0; 
								cc = adjustAColumn(cc, row.getCells().get(qq).getX(), row.getCells().get(qq).getEndX(), leftX_tableColumns, rightX_tableColumns);
								tc.setColumnNum(cc);
							}
						}//end{middleColumn}
					}//end {else}
				}//end{for all pieces in a line}
			}//end if()
		}//end for()
		
		
		/*
		 * Adjusts columns with the information of heading rows
		 */
		for (int pp=0; pp<heads; pp++) {		
			int cellsThisLine = tc.getRows().get(pp).getCells().size();
			for (int dd=0; dd<cellsThisLine; dd++) {
				float b = tc.getRows().get(pp).getCells().get(dd).getX();
				float e = tc.getRows().get(pp).getCells().get(dd).getEndX();
				cc = adjustAColumn(cc, b, e, leftX_tableColumns, rightX_tableColumns);
			}//end(for)
		}//end(for)
		tc.setColumnNum(cc);
		tc.setLeftX_tableColumns(leftX_tableColumns);
		tc.setRightX_tableColumns(rightX_tableColumns);
	}
874745
def get_chi(self, scalar=None):
        """'"""
        phi = self.get_phi(scalar=scalar)
        return mcc_chi(phi, self._num_samples)