A ragged array (or jagged array) is an array of arrays. The elements of a ragged array can be of different dimensions and sizes.
Questions tagged [ragged]
78 questions
0
votes
2 answers
xarray variable from list of differing length lists
I have a function to create an xarray Dataset based on various output from a model. One of the pieces of information I collect is a list of lists (not same length). This variable is called cids and has the same dimension repo_id as other variables.…

user5781
- 33
- 1
- 6
0
votes
1 answer
ragged *char 2d array with realloc
i was wondering how do i create a ragget 2d string(char*)array in c . (my example code looks like this)
int j = 1;
char **array = null;
... read string...
*array = (char *) realloc(sizeof(char *) * j);
j++;
(sirAvertisment[j] =…

Hex
- 3
- 3
0
votes
2 answers
Concatination of Ragged Tensors Raises Value Error
I am following the view on youtube here,
it shows the code
text_1 = tf.ragged.constant(
[['who','is', 'Goerge', 'Washington'],
['What', 'is', 'the', 'weather', 'tomorrow']])
text_2 = tf.ragged.constant(['goodnight'])
text =…

chikitin
- 762
- 6
- 28
0
votes
1 answer
Pick random entry from two ragged tensors
How do I pick random entries from two ragged tensors? For example,
c = tf.ragged.constant([[1, 2, 3], [4, 5]])
v = tf.ragged.constant([[10., 20., 30.], [40., 50.]])
r = tf.random.uniform([1, 1], maxval=2, dtype=tf.int32)
with tf.Session() as…

JEM_Mosig
- 246
- 1
- 13
0
votes
0 answers
Why does `gnuplot` plot look ragged?
I have a data file with six pairs of XY-data. I want to plot the six functions in one graphic. But when I do so the lines look kind of ragged.
Here is my code:
set terminal pdf
set output 'test.pdf'
set xrange [10:150]
set yrange [-150:5000]
set…

simonk
- 1
- 2
0
votes
0 answers
Java Ragged 2D Array (one line)
I am attempting to write a program with specification for a Beginners Java class. The code is below. There is one line that is not compiling about 30 lines in inside the first for look of the first do while loop near.
score[i + 1][i] =…

iAm Bob
- 1
- 1
0
votes
2 answers
R and Zoo: moving average with ragged data?
I want to calculate moving averages to fill the NA entries with the known entries 3, 5 and 1. How can I do this with the package zoo in R?
Input
> library(zoo)
> hh <- c(NA, NA, NA, 3, NA, 5, NA, 1, NA, NA, NA, NA)
Fails
Fail with rollmean
>…

Regan Alpha
- 67
- 5
0
votes
1 answer
Reading and concatenating CSV files with varying (nrow, ncol) dimensions
I have a directory of tab separated log files with varying dimensions and I am trying to load them into R.
Dir:
File1 (col1,col2,col3)
File2 (col3,col4,col5,col6,col7)
File3 (col1,col8,col9,col10)
To do this: I concatenated all the files in the…

BRZ
- 695
- 4
- 13
- 25
0
votes
1 answer
Java simple ragged Array query
I'm trying to write a Java program that will take as input:
The number of students
The number of courses taken by each student
It will then calculate the average for each student.
But I'm having trouble trying to read in the values. Please let me…

Kareem Youssef
- 37
- 1
- 3
- 11
0
votes
1 answer
Create a ragged/jagged 3d array in java
I want to create a ragged 3d array as followes in java.
Terminology: A 2D array is said to consist of rows and columns. A 3D array is said to consist of slabs, where each slab consists of a 2D array.
The first slab has three rows, the second slab…

Isuru Pathirana
- 1,060
- 1
- 16
- 37
0
votes
0 answers
Ragged/Jagged Array Null Pointer Exception
in the code that follows I take counter[] which has a lot of values within it that are 0, and determine the amount of 0 values.
With that I create the first half of a jagged array (counter3) that has a row for every line in counter[] with a value,…

loegare
- 142
- 1
- 11
0
votes
1 answer
R / Sql / Other : Dealing with Ragged Data Dump file
I have a text file that is comma delimited but each row does not have the same number of fields. The first field has a 2 digit code that determines how many fields will be in that row (it's a code NOT a count). I'm curious if there's some kind of…

screechOwl
- 27,310
- 61
- 158
- 267
-1
votes
3 answers
How would you iterate through a 2D array by going down through columns? I want this for a ragged array but seeing in a regular array first might work
I would like my array to from index to index like thisfor example: (0,0), (1,0), (2,0) etc. I've tried what seems like it should be the right way, but my loops stop after the first column and I get an index out of bounds exception.
Here's what I…

Axel K.
- 1
- 1
-1
votes
5 answers
how can i make shorter my Jagged(Ragged ) code?
How can i write a shorter code with a for loop, Is it possible? instead of writing;
int array[][] = new int[10][];
array[0] = new int[1];
array[1] = new int[2];
array[2] = new int[3];
array[3] = new int[4];
array[4] = new…

Lena Monika Marshall
- 113
- 1
- 9
-1
votes
1 answer
Processing a ragged 2 dArray
/*I need to store some information in a ragged 2d array.
So i want this program to take in ex. 3 names, and for each name i want the array to store a number of courses for each name. ex. name anders have take 3 courses, oop, intP , appDesign.
I have…

Rangerguy
- 69
- 8