open2c / bioframe

Genomic interval operations on Pandas DataFrames
MIT License
173 stars 28 forks source link

#167: Replaced np.int with int as the attribute is deprecated by numpy #192

Closed harshit148 closed 6 months ago

harshit148 commented 7 months ago

Tried to reproduce the two errors specified here:https://github.com/open2c/bioframe/issues/167 But looks like the first error is already fixed and the output is as expected and for the second error I simply needed to replace the deprecated numpy.int with int and the method now is returning an empty dataframe

>>> import bioframe
>>> import pandas as pd
>>> df = bioframe.from_any([['chr1', 100, 110]], name_col='chrom')
>>> bioframe.closest(df, df.copy(), ignore_overlaps=True)
  chrom  start  end chrom_  start_  end_  distance
0  chr1    100  110   <NA>    <NA>  <NA>      <NA>
>>> df2 = pd.DataFrame({c: pd.Series([], dtype=t) for c, t in df.dtypes.items()})
>>> bioframe.closest(df2, df)
Empty DataFrame
Columns: [chrom, start, end, chrom_, start_, end_, distance]
Index: []
>>>