question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Should log1p edit .X inplace?

See original GitHub issue

It’s a little confusing why something like normalize_total doesn’t inplace edit the data, but log1p does.

https://github.com/theislab/scanpy/blob/5533b644e796379fd146bf8e659fd49f92f718cd/scanpy/preprocessing/_simple.py#L309-L321

Why should out be set here?

Screen Shot 2020-09-15 at 7 35 03 PM

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
ivirshupcommented, Sep 23, 2020

We will always try to make .X a reference to the passed array. There may be cases where we need to make a copy, but we’ll try to avoid that.

0reactions
adamgayosocommented, Sep 22, 2020

So with this change .X would always be a view of the same data, regardless of type?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Should log1p edit .X inplace? · Issue #1415 · scverse/scanpy
It's a little confusing why something like normalize_total doesn't inplace edit the data, but log1p does.
Read more >
When should log1p and expm1 be used?
For real-valued arguments, log1p(x) and expm1(x) should be used when x is small, e.g., when 1+x=1 in floating point accuracy.
Read more >
scanpy.pp.calculate_qc_metrics - Read the Docs
Set to False to skip computing log1p transformed annotations. Depending on inplace returns calculated metrics (as DataFrame ) or updates adata 's obs...
Read more >
Numpy log1p Example | np log1p() in Python - Morioh
Numpy log1p() is a math function that helps the user to calculate the natural logarithmic value of x+1 where x belongs to all...
Read more >
is log1p the "correct" way of doing log scale transformation of ...
No. log1p(x) does not compute the logarithm of x and should not be used if you ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found