Return a new :class:`DataFrame` containing rows only in
        both this frame and another frame.

        This is equivalent to `INTERSECT` in SQL.
501197
def intersect(self, other):
        
        return DataFrame(self._jdf.intersect(other._jdf), self.sql_ctx)
574716
def _shape(self, df):
        

        row, col = df.shape
        return row + df.columns.nlevels, col + df.index.nlevels
992847
def _GetRow(self, columns=None):
        """"""

        row = self._table[self._row_index]
        if columns:
            result = []
            for col in columns:
                if col not in self.header:
                    raise TableError("Column header %s not known in table." % col)
                result.append(row[self.header.index(col)])
            row = result
        return row
1084176
def row(self, columnnames=[], exclude=False):
        
        from .tablerow import tablerow
        return tablerow(self, columnnames, exclude)
617961
def intersection(self, other):
        
        # if self or other is empty the intersection will be empty
        result = IntervalSet()
        for other_inter in other:
            for interval in self:
                this_intervals_intersection = other_inter.intersect(interval)
                if this_intervals_intersection is not None:
                    result._add(this_intervals_intersection)
        return result
1334690
def dataframe(self,asql, logger = None):
        """"""
        import pandas as pd
        from ambry.mprlib.exceptions import BadSQLError

        try:
            def yielder(cursor):

                for i, row in enumerate(cursor):
                    if i == 0:
                        yield [ e[0] for e in cursor.getdescription()]

                    yield row

            cursor = self.query(asql, logger)

            yld = yielder(cursor)

            header = next(yld)

            return pd.DataFrame(yld, columns=header)
        except BadSQLError as e:
            import traceback
            self._logger.error("SQL Error: {}".format( e))
            self._logger.debug(traceback.format_exc())
438191
def intersect(self, *queries):
        ''''''
        q = self._clone()
        q.intersections += queries
        return q
182149
def intersect(self, other):
        
        if not self.overlap(other):
            return None

        newstart = max(self._start, other.start)
        newend = min(self._end, other.end)
        return Range(newstart, newend)
1195892
public static AbstractMatrix getInstance(int rows, int cols, Class<?> cls)
    {
        return new AbstractMatrix(rows, Array.newInstance(cls, rows*cols));
    }
856915
def intersection(self, other):
    

    # we only deal with the case of two lists here
    length1 = len(self)
    length2 = len(other)

    # initialize list of output segments
    ostart = -1
    outlist = []
    iseg2 = -1
    start2 = -1
    stop2 = -1

    for seg1 in self:
      start1 = seg1.start()
      stop1 = seg1.end()
      id = seg1.id()

      # loop over segments from the second list which overlap this segment
      while start2 < stop1:
        if stop2 > start1:
          # these overlap

          # find the overlapping range
          if start1 < start2:
            ostart = start2
          else:
            ostart = start1
          if stop1 > stop2:
            ostop = stop2
          else:
            ostop = stop1

          x = ScienceSegment(tuple([id, ostart, ostop, ostop-ostart]))
          outlist.append(x)

          if stop2 > stop1:
            break

        # step forward
        iseg2 += 1
        if iseg2 < len(other):
          seg2 = other[iseg2]
          start2 = seg2.start()
          stop2 = seg2.end()
        else:
          # pseudo-segment in the far future
          start2 = 2000000000
          stop2 = 2000000000

    # save the intersection and return the length
    self.__sci_segs = outlist
    return len(self)
451744
def intersection(self, other):
        
        if self.capacity != other.capacity or \
            self.error_rate != other.error_rate:
            raise ValueError("Intersecting filters requires both filters to \
have equal capacity and error rate")
        new_bloom = self.copy()
        new_bloom.bitarray = new_bloom.bitarray & other.bitarray
        return new_bloom
933140
def subtract(self, other):
        
        return DataFrame(getattr(self._jdf, "except")(other._jdf), self.sql_ctx)
870137
def corrdfs(df1,df2,method):
    
    dcorr=pd.DataFrame(columns=df1.columns,index=df2.columns)
    dpval=pd.DataFrame(columns=df1.columns,index=df2.columns)
    for c1 in df1:
        for c2 in df2:
            if method=='spearman':
                dcorr.loc[c2,c1],dpval.loc[c2,c1]=spearmanr(df1[c1],df2[c2],
                                                        nan_policy='omit'
                                                       )
            elif method=='pearson':
                dcorr.loc[c2,c1],dpval.loc[c2,c1]=pearsonr(df1[c1],df2[c2],
#                                                         nan_policy='omit'
                                                       )
                
    if not df1.columns.name is None:
        dcorr.columns.name=df1.columns.name
        dpval.columns.name=df1.columns.name
    if not df2.columns.name is None:
        dcorr.index.name=df2.columns.name
        dpval.index.name=df2.columns.name
    return dcorr,dpval
410829
def is_fullfilled_by(self, other):
        
        # allow the other index to be equally large only. It being larger is an option
        # but it creates a problem with scenarios of the kind PRIMARY KEY(foo,bar) UNIQUE(foo)
        if len(other.get_columns()) != len(self.get_columns()):
            return False

        # Check if columns are the same, and even in the same order
        if not self.spans_columns(other.get_columns()):
            return False

        if not self.same_partial_index(other):
            return False

        if self.is_simple_index():
            # this is a special case: If the current key is neither primary or unique,
            # any unique or primary key will always have the same effect
            # for the index and there cannot be any constraint overlaps.
            # This means a primary or unique index can always fulfill
            # the requirements of just an index that has no constraints.
            return True

        if other.is_primary() != self.is_primary():
            return False

        if other.is_unique() != self.is_unique():
            return False

        return True
134131
def intersection(self, other):
        
        taxa1 = self.labels
        taxa2 = other.labels
        return taxa1 & taxa2
404945
def _row_selector(self, other):
        
        if type(other) is SArray:
            if self.__has_size__() and other.__has_size__() and len(other) != len(self):
                raise IndexError("Cannot perform logical indexing on arrays of different length.")
            with cython_context():
                return SFrame(_proxy=self.__proxy__.logical_filter(other.__proxy__))
673235
def get_sub_dataframe(keys, by_position: true)
      return Daru::DataFrame.new({}) if keys == []

      keys = @index.pos(*keys) unless by_position

      sub_df = row_at(*keys)
      sub_df = sub_df.to_df.transpose if sub_df.is_a?(Daru::Vector)

      sub_df
    end