Questions tagged [flatten]
Flattening refers to either reducing a multi-dimensional array to a single dimension or to reducing a class and class methods to handle based function calls.
flatten
1,599
questions
0
votes
0
answers
15
views
Unexpected coordinate switching when reshaping object positions into 3D grid after flattening and integrating
I am working on processing and analyzing velocity field data from VTI files using Python. The workflow includes reading VTI files, extracting velocity data, computing object trajectories, generating ...
0
votes
0
answers
22
views
Snowflake flatten JSON column in table
I have a column in a table that I need to flatten. Below is the JSON
[
{
"Name": "InputData",
"Value": "{ \"EventType\" : \"Threshold\",...
0
votes
1
answer
43
views
Left join later flatten works not like left join, but the same as inner join
With this data:
create or replace table test_json as
select
parse_json('{
"include": [
"x",
"y",
"z"
...
0
votes
1
answer
39
views
How to use query and flatten formula in google sheets with null & desc
I'm trying to get column A by order of 'desc' based off whether column B is empty. I would like all of column A cells that have empty column B cells to be at the bottom. If possible without any helper ...
2
votes
2
answers
35
views
Matrix indexing/flattening
I am given a matrix with dimensions dim = nxmx4. I would like to flatten this matrix to a new 1-dimensional matrix with length l = n*m*4 using 3 nested for-loops.
for (let x = 0; x < n; x++) {
...
0
votes
1
answer
75
views
flatten JSON with Spark SQL
Im trying to explode the JSON structure using the Spark SQL in databricks.
I have the below code. having trouble to explode the "operationalOrders" which normally is the "ArrayType"...
2
votes
2
answers
75
views
Julia: Flattening array of `String`s
This is essentially the same question as
Julia: Flattening array of array/tuples
but for array of Strings. The Iterators.flatten(xs) solution shown in the above thread is excellent for numbers. But, ...
0
votes
1
answer
51
views
Jolt to transform a multilayered Nested JSON to flat JSON
Input
{
"CustomerMaster": {
"Rootnode": {
"KUNNR": "0000000199",
"NAME1": "COOP Sverige AB",
"LAND1": &...
1
vote
1
answer
60
views
Why the speed difference in the iteration over a C# jagged array?
I have the following test code using a measurement of the execution speeds:
using System.Diagnostics;
namespace Jagged_array_test {
internal class Program {
static void Main(string[] args)...
2
votes
1
answer
50
views
Normalizing Nested (hierarchical) Json in pyhton
I am extracting an API where the json response I get is as follows
{
"prod": "Food",
"id": "F1",
"item":
[
{
"prod": &...
0
votes
2
answers
115
views
Using scipy.optimize library to find minimum of a function
initially I write this code through many iterations and it works fine.
import numpy as np
from scipy.optimize import minimize
# Define the sigmoid function
def sigmoid(x):
return 1 / (1 + np.exp(...
0
votes
3
answers
53
views
Converting Rows of data into a single column, including IMAGES
I have found many solutions that pull rows of data into a single column of data, but I cannot figure out a solution that will also return images as part of the data.
Sample data is here: https://docs....
0
votes
1
answer
31
views
How to flatten a nested json
I want to flatten a nested input JSON. The JSON contains a product with "n" product attributes. Attached to the product are "n" items, each of this item can have "n" ...
0
votes
1
answer
56
views
Can/should a single table subquery be flattened
I was going through my course material for the SQL class that I am taking and it mentioned that in order to make programs run faster and run in one pass using joins verses a subquery. It stated that ...
0
votes
2
answers
32
views
Google Sheets: Repeat "Product SKUs" for 5 rows per SKU in another Sheet
Basically I need to get SKUs in one sheet formatted like this:
Column A
SKU 1
SKU 2
SKU 3
To become formatted like this in another sheet:
Column A
SKU 1
SKU 1
SKU 1
SKU 1
SKU 1
SKU 2
SKU ...