aertslab / arboreto

A scalable python-based framework for gene regulatory network inference using tree-based ensemble regressors.
BSD 3-Clause "New" or "Revised" License
54 stars 25 forks source link

Pandas version of as_matrix is deprecated #24

Open RRCinci-Lu opened 4 years ago

RRCinci-Lu commented 4 years ago

I was trying to use pandas version 1.0.0 with grnboost2. However, I ran into a problem where the as_matrix call part of grnboost2 does not work because it is deprecated (I think people use .values instead). Do you know a way to use the older version of pandas so I do not run into this problem?

Thanks, I am somewhat new to programming.

rcannood commented 4 years ago

You can try to pass your object as a matrix rather than a data frame.

Alternatively, you can force an older version of pandas with pip install --user "pandas<1.0"

diegoalexespi commented 4 years ago

I've been able to get around this by locally going into algo.py and changing line 214 from expression_matrix = expression_data.as_matrix() to expression_matrix = eexpression_data.as_numpy()

deto commented 4 years ago

@d93espinoza did you mean to_numpy instead of as_numpy?

f6v commented 4 years ago

The way to run it is:

network = grnboost2(expression_data=ex_matrix.to_numpy(), tf_names=tf_names, gene_names=ex_matrix.columns)

gene_names is required in case you pass a matrix as the input to the function.