A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://stackoverflow.com/questions/tagged/awkward-array below:

Newest 'awkward-array' Questions - Stack Overflow

2 votes

1 answer

55 views

How to use ak.Array with index arrays to create a custom masked output?

I have these arrays in Awkward Array: my_indices = ak.Array([[0,1],[0],[1]]) my_dummy_arr = ak.Array([[1,1],[1,1],[1,1]]) I want to generate this result: [[1,1],[1,0],[0,1]] Basically, for each sub-...

asked May 28 at 10:52 Why np.vectorize doesn't work for awkward arrays?

I have a simple vectorized function (actually my real case is more complicated), as: @np.vectorize def f(x): if x > 0: return 1 else: return -1 Why it is not working with ...

asked Mar 31 at 14:30

0 votes

0 answers

54 views

How to Slice An Awkward Array of Records by the Length of the Record Value

I'm new to posting questions on here and to using awkward arrays. Let me know if I should re-format my question or include more information. I am using awkward/2.6.7, awkward_cpp/37, jupyterlab==3.0....

asked Mar 20 at 0:15

2 votes

1 answer

129 views

How can I convert the datatype of a numpy array sourced from an awkward array

I have a numpy array I converted from awkward array by to_numpy() function, and the resulting array has the datatype: dtype=[('phi', '<f8'), ('eta', '<f8')]). I want to make it a regular tuple ...

asked Nov 22, 2024 at 12:59

1 vote

2 answers

341 views

Accessing elements of an awkward array that are not a passed-in index

I'm trying to access the elements of an awkward array that do not correspond to some particular set of indices. I have 3 events in total with one jet per event and some number of leptons. Each lepton ...

asked Jun 22, 2024 at 23:02

1 vote

0 answers

107 views

Awkward Array broadcasting and linear indexing, reshaping an Awkward Array

I'm trying to use numpy-like syntax on an awkward.Array with variable sizes in the second dimension, but it's still confusing.. In numpy i have normals.shape # (N,3) idcs.shape # (m,k) normals[idcs]...

asked Jun 17, 2024 at 14:49 Slicing MultiIndex pandas Dataframe

I am working with awkward arrays and dumping information to pandas dataframe with multiindex: >>> import awkward as ak >>> import pandas as pd >>> ak_arr = ak.Array([ ... ...

asked Apr 22, 2024 at 11:06

2 votes

2 answers

330 views

Converting from awkward arrays into torch arrays

Note: I am using awkward version 1.10.3. So, the general overview is that I have a set of data that is in awkward arrays, and I want to be able to pass this data to a simple feedforward pytorch model. ...

asked Mar 22, 2024 at 11:11 How to lazily read from parquet with awkward2

I'm thinking of migrating from awkward 1 to 2. I used lazy reading from parquet file using awkward1. tree = ak.from_parquet(filename, lazy=True) # data is not read print(np.max(tree["x"]),...

asked Mar 1, 2024 at 15:00

1 vote

1 answer

371 views

AttributeError: module 'awkward' has no attribute 'util'

Here is the code import pandas as pd import numpy as np import awkward import uproot_methods The version of pandas is 2.1.1, and the version of numpy is 1.23.1, and the version of awkward is 0.9.0, ...

asked Sep 28, 2023 at 10:06

-1 votes

1 answer

102 views

Module 'awkward' has no attribute 'load'

The problem poped up when I try to use function awkward.load(), but there comes the message "module 'awkward' has no attribute 'load'", and I think the problem is that the newest version of ...

asked Sep 27, 2023 at 1:18

1 vote

0 answers

148 views

Saving concatenated Awkward-Arrays with Different Fields

So I have been working with some data that includes both electrons and muons. Now for this we have to find opposite-sign same-flavour dilepton pairs, i.e. e+e- or mu+mu-. However, I run into problems ...

asked Sep 8, 2023 at 13:57 To_parquet giving error: __arrow_array__() got an unexpected keyword argument 'type'

I'm reading a root file using uproot and converting parts of it into a DataFrame using the arrays method. This works fine, until I try to save to parquet using the to_parquet method on the dataframe. ...

asked Aug 11, 2023 at 11:35

1 vote

0 answers

176 views

Using `awkward` array to keep track of two different combinations of particles

I'm building on a previous question about the best way to use awkward efficiently with combinations of particles. Suppose I have a final state of 4 muons and my hypothesis is that these come from some ...

asked Jul 28, 2023 at 18:40

0 votes

2 answers

439 views

Adding first, second, etc element of an awkward array together

I am very new to awkward arrays (and python in general) and just want to know how I could add the first elements of each array in an ak.array together. E.g my_array = [[1,2,3], [4,5,6], [7,8,9].....] ...

asked Jun 26, 2023 at 10:27

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4