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.

Requesting Awkward 0 → Awkward 1 cheat-sheet

See original GitHub issue

I’ve recently started switching over to awkawrd1, and I’d like to create a new array with the same layout (or just shape - I’m not yet sure if different content types are considered different layouts - say int vs float or even int8 vs int32). For example, I have a constant mass hypothesis that I want with every jagged four vector. Or a constant weight for each row. I’m happy to add a concrete example if helpful.

In awkward0, I would call ones_like() and then multiply by my value. For numpy, I would use np.ones_like(...) and again multiply. But having looked through the awkward1 documentation, I can’t seem to find the equivalent. As far as I understand, I can’t just do this with ak.Array. I’m sure it’s possible in awkward1 and that I’m overlooking the right term (I’ve been reading the awkward1 docs over a number of updates, so it’s certainly possible that I’ve missed it), but some additional documentation on this could be helpful - I imagine that I won’t be the only person looking for something like this. Or if it already exists, could you point me in the right direction?

Thanks!

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
raymondEhlerscommented, Jul 6, 2022

No worries at all @jpivarski! You always answer so helpfully and quickly that it makes issues like this quite minor. (Plus, I made the transition years ago). I really appreciate the effort that you and others put into such a useful package!

1reaction
jpivarskicommented, Jul 6, 2022

No, this sounds like a to-do item that gets “done” by waiting so long that it’s no longer relevant. We probably have more new users of Awkward 1 than transitioning users of Awkward 0.

image

Sorry I fell off the ball on this, @raymondEhlers. I’ll close the issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Requesting Awkward 0 → Awkward 1 cheat-sheet #391 - GitHub
I've recently started switching over to awkawrd1, and I'd like to create a new array with the same layout (or just shape -...
Read more >
Uproot 3 → 4+ cheat-sheet
The Uproot 3 → 4 transition was primarily motivated by Awkward Array 0 → 1. The interface of Awkward Array significantly changed and...
Read more >
The Art of the Awkward 1:1 - Medium
Whatever you do, don't waste the 1:1. Plan to be awkward. Spend a few minutes at the beginning of the week thinking what...
Read more >
Dan North Was Right + FREE CHEAT SHEET - YouTube
Grab your FREE TDD vs BDD Cheat Sheet : https://www.deve... ... This is a little bit awkward. ... SUBSCRIBE to this Channel: →...
Read more >
Help talk:Cheatsheet/Archive 1 - Wikipedia
Unformatted text. a space at left makes page too wide if lines are single spaced. I think the software means by the dotted-line...
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