226 questions
2
votes
2
answers
288
views
Flatten a hierarchy with recursive LAMBDA formula, or with Power query?
In excel I have this table with 2 columns :
Table called T_DATA
dataset
datasource
APP1
DTM1
DTM1
Dataset1
DTM1
Dataset2
DTM1
Dim1
DTM1
Dim2
Dataset1
Raw1
Dataset2
Dataset3
Dataset2
Raw5
Dataset3
Raw2
...
0
votes
0
answers
125
views
Eclipse: Package Presentation -> Flat
In Eclipse, I am trying to change my view from Hierarchical to Flat within the Package Explorer view.
I read another post on how to do this:
Click on 3 dots (View Menu)
Select Package Presentation
...
0
votes
0
answers
51
views
SSIS - Export large amount of data to Flat File. Heavy consumption TEMPDB
We got a problem.
It is necessary to load a large amount of data into a text file, the download is carried out by a query that includes several joins and filters.
The package was created according to ...
0
votes
2
answers
50
views
How to build a tree from flat array of objects
I am trying to build a tree array from a flat array of objects.
The category field is structured as an array because it can have n categories
let data = [
{
category: [
"Kat1"
...
0
votes
2
answers
362
views
Flat file connection manager exports all values into column A (CSV file)
When using a flat file connection in a SSIS package in VS, all the different values go into column A, instead of being separated into different columns. The preview in the flat file manager dialogue ...
0
votes
1
answer
70
views
change an imbricated list to a flat list in django, python
I want a flat list for my categories list in output, but this code doesn't do that. It still shows the categories in imbricated list. Can someone help me?
This is the code:
@api_view(['GET'])
def ...
0
votes
4
answers
2k
views
How to flat an array of arrays and order it in javascript
Is there a better way to flat an array of arrays of integers? this solution is easy but I really don't know if it's time complexity is the best.
const list = (arr) => {
//to avoid mutating the the ...
0
votes
1
answer
38
views
Can you transform a list to a tree where items in the list have children but no depth or parent?
Data looks as follows:
Each node has a unique id (
Nodes have a children key which is either null or an array of ids.
Nodes can have one parent
Nodes do not have a parent or depth reference
Input:
...
0
votes
1
answer
185
views
In RXJS : replace an infinite observable by an other each time the first emits
I would like to achieve the same thing than below in a smartest way :
charteringsPassFromZeroToOneEmpty$
.pipe(
withLatestFrom(transportFeatures$),
map(
([nothing, ...
1
vote
1
answer
101
views
Obtain values fron nested array of objects
I have the fallowing data structure:
products = [
{
name: 'Menu1',
subitems: [
{
name: 'Menu2'
},
]
},
{
...
0
votes
2
answers
362
views
change dataframe pivot_table headers to save it in an excel file
I have a nested hearders in a dataframe after pivoting it and I'd like to make it flat, with repeated item on each rows (like in a excel)
May you help me ?
import pandas as pd
data = {
"year&...
0
votes
1
answer
38
views
Calculate % change in flat tables
From df1 I would like to calculate the percentage change from, which should give df2. Would you please assist me?
df1
lst=[['01012021','A',10],['01012021','B',20],['01012021','A',12],['01012021','B',...
0
votes
2
answers
215
views
Triple nested list to a list of string in python
I have a triple nested list and trying to grab the same position of the most inner list elements and join as a list of strings by the second nested level in python.
input=[[['a b c'], ['d e f'], ['g h ...
1
vote
0
answers
262
views
Product Flat Data index exception: SQLSTATE[42S22] [While installing Magento 2.4.1 as well as 2.4.3 enterprise version] Re-indexing issue
After installing Magento 2.4.1 version(Enterprise version)on windows and After applying the di compile command and while applying re-indexing I am getting the following error even with the fresh ...
0
votes
2
answers
288
views
Get total length of all lists inside a map of tuples
I am working on a Scala project and I have a Map of type Map[Long, Tuple2[Boolean, List[Int]]].
I need to assign the total number of elements in all lists within the map to a variable.
I currently ...
1
vote
1
answer
7k
views
How to remove leading zeroes & trailing spaces in COBOL
Hi I have requirement to read a input file, each record contains certain record
01 FILE-DATA.
05 FILE-FIELD-A PIC 9(18).
05 FILLER PIC X(01) VALUE '*'.
05 FILE-FILED-B PIC X(...
0
votes
2
answers
157
views
Transpose a table row by row
I need to transpose parts of a table row by row. The following example illustrates what the result needs to look like:
I tried different combinations of arrayformula(), flatten() and transpose(), ...
-4
votes
1
answer
58
views
JavaScript push on a array which has been populated using map created a nested 2d array not a 1d array
// Data
const account1 = {
owner: 'Jason Mike',
movements: [200, 450, -400, 3000, -650, -130, 70, 1300],
interestRate: 1.2, // %
pin: 1111,
};
const account2 = {
owner: 'Jessica Davis',
...
1
vote
1
answer
150
views
flat_table getting ValueError: cannot reindex from a duplicate axis , My problem is different for this error
I have dataframe as below
behaviour_attributes
0 {'className': 'behaviour', 'type': 'behaviour', 'verb': 'can_perform_stw_everything', 'bs': [{'bid': ObjectId('6050da979198a053c3a02484'), 'n': '...
-2
votes
3
answers
590
views
JAVASCRIPT remove parent key from array [duplicate]
I have an array and i need to remove the top most 0 key, and leave the array with the following structure:
[array(24)]
0:{...}
1:{...}
2:{...}
3:{...}
until last key (24)
Right now this is how the ...
0
votes
1
answer
361
views
Implementation of the d-dimensional torus
I need to create a topological object known as a d-dimensional torus, d >= 2. As an example, a square, whose opposite sides are equivalent, is a 2-dimensional torus. For dimension 3, both the ...
0
votes
1
answer
69
views
Array - grab all field items independent of level
Let's assume I have an array such as this here:
const data = {
id: "helloworld",
type: "Collection",
_embedded: {
items: [{
fields: [{
id: "bla",
fields: [{
...
1
vote
1
answer
354
views
PHP Flat object to hierarchical object
There have been a few questions already on the topic, but they typically relate to turning hierarchal objects into flat objects, a non-issue for me. However, I am currently completely stumped in ...
-4
votes
4
answers
1k
views
Flat an array tree js
Can you help me please to flat this tree?
I have tried a few things and it didn't work.
I would like to get the fastest way(Algorithm).
const source = [
{
item: { id: 1, name: "item name&...
-3
votes
2
answers
38
views
How Can I convert a nested array of object into a flat Array javascript
I've got this
const nested = [
[{ id: 1, name: "carl" }],
[{ id: 2, name: "lety" }],
[{ id: 3, name: "jim" }]
];
but I need this:
const flat = [
...
0
votes
1
answer
361
views
Change colors of flat scroll bars (custom palette in FlatSB_SetScrollProp function)
One of my customers uses the standard flat scroll bars introduced in MSIE 4 inside the list/grid controls in his VB6 app. Now he wants to implement a dark theme in his app and needs to colorize these ...
-2
votes
2
answers
197
views
How to flat obj in TS
By the way I already solve the problem of this issue, but I did not find any questions about that. And I decided to upload my code here to help guys like me.
I have object like this:
{
a: 'a',
b: '...
-1
votes
1
answer
49
views
Surfaces calculator
print("Quadrat, Rechteck, Kreis")
a = input("Bitte wählen sie eine Polygon.")
if a == "Quadrat":
q = int(input("geben sie die seitenlänge des quadraten an:"))
Q = q*2
print("Der Umfang ...
2
votes
2
answers
4k
views
how to create tree from flat array using in Angular
I need to show a tree from a flat array of data using Angular and I'm open to use any package to render the tree. as a user, I should be able to click on a node and find out details such as node ID ...
-1
votes
1
answer
59
views
Flat list hierachy string using python
how to flat :
paths = ['[a, c, e]', '[[a, c], [a, b], d]', 'z']
To:
paths = [[a, c, e, z], [a, c, d, z] [a, b, d, z]]
-1
votes
1
answer
76
views
Unwanted side effects when flattening a list [duplicate]
I was just testing some algorithms to flatten a list, so I created 3 lists inside a list, and then tried to flatten it. I never touch the original list, the variables are named different, but when I ...
0
votes
1
answer
88
views
Javascript array from flat to tree
all,
I have a technical task from one company. As I am starting only the task is quiet a difficult for me.
Tha flat array is:
[
{ id: '1', name: 'name 1', parentId: null },
{ id: '2', ...
-1
votes
2
answers
61
views
Decide JSON data python parsing flat
it's been a while since I've been stuck on a subject to which I can't find the desired solution.
Example: I have a json given like this:
{
"SECTION": {
"ID": 1,
"COMMENT" : "foo ...
-1
votes
1
answer
124
views
Flatten a list of dictionary that contains a list of dictionaries in python
How can I organize this info to flatten into a dictionary with no duplicates? (Type and name doesn't matter,
they can be repeated but the tuple (company, year_semester, area, model, category, measure)...
0
votes
1
answer
299
views
How to import a non-structured flat file into Python using pandas?
I'm trying to import a .db file into pandas. The file is ordered as:
Person 1
Characteristic 1: Value
Characteristic 2: Value
Person 2
Characteristic 1: Value
Etc
I want to import the data into ...
1
vote
1
answer
145
views
Making a flat file from vector array
My plan is to make a flat file in two columns and for that this is what I have initiated two vector arrays. Two vector arrays will be in two column of the flat file. I think the problem I'm having is ...
2
votes
2
answers
2k
views
Error: acc.concat is not a function for my js flat array function?
I am trying to write a js flat function like Array.prototype.flat()
using concat+recursion. However, my code is always throw a acc.concat is not a function error. I don't know what's wrong with my ...
-1
votes
1
answer
53
views
Flattening and mapping of keys of a nested JSON using python
I am very new to JSON. I am unable to grasp the structuring of JSON file.
I have a Json file that resembles like this,
{"employeeId":{"0":02100, "1":02101, "2":02102,... "1000000":021000000},
"...
4
votes
1
answer
5k
views
Array.prototype.flat() is not working in command line using Node JS
I am trying to test the array.flat method inside Visual Studio code using node js from the command line. When I run the code i get:
"TypeError: arr.flat is not a function"
I have ran the code in ...
0
votes
1
answer
346
views
Update fails when using results of a flatten groupjoin (lambda)
I'm trying to update a whole table to modify some columns and store Id from another table in there.
The following code fails at the update statement and I can't figure out why.
db.gt_s_one
....
0
votes
0
answers
167
views
How to get precise correlation factor for two flat signals in python?
At the moment I am struggeling with a correlation check of two time uniform signals, which are stored in a Pandas dataframe. If I use Pandas correlation function in Python for flat graphs I get ...
1
vote
0
answers
153
views
JSON flattening with object duplication on array property for CSV generation
I am looking for a way to transform JSON data into a flat "csv-like" data object. In some way, I am looking to "sqlirize" a mongodb collection. I have already check some json flat libraries in NPM ...
0
votes
0
answers
92
views
Extract all Arrays out of Object Array JavaScript?
I have an object array looking like this:
[
{
"number": 1,
"salary": 2000,
"premium": 200,
"taxes": 500,
"friends": [
{
"number": 1,
"salary": 10,
"...
1
vote
1
answer
69
views
Averaging a flatfile with dynamic columns greater than 2gb in SSIS
I need to summarise a huge csv file produced as the output from another process. The file varies, and can have different headers. Every file has a string field in col1, a look number (integer) in col ...
0
votes
0
answers
613
views
How to identify checkboxes in a flat pdf?
Team,
I have to validate a flattened pdf as part of a requirement. This pdf has checkboxes. I used Apache PDFBOX library to read the contents of this PDF. It is only reading the text but not ...
3
votes
2
answers
468
views
Is using flat map in such a way is proper?
Basically while answering one of the question on SO related to nested array flattening i have answered question with using recursive flattening.
var exampleArray = [ [1,2,3,4], [1,2,[1,2,3]], [1,...
0
votes
4
answers
647
views
React Native Firebase Flat List data not showing in Text & Image
My data's not showing, I'm using firebase realtime and I tested on react native android emulator in android studio:
<FlatList
data={this.state.userList}
keyExtractor={(item,index)=>item....
0
votes
2
answers
502
views
How to access elements of 1-D array through some other 1-D array?
I am very new to Julia, even new to programming. Therefore, please excuse me for simple doubts.
consider the below Matlab Example:
A=[10; 20; 30; 40; 50];
B=[1; 3; 5];
The result of A(B)=0 in the ...
0
votes
1
answer
524
views
WebGL2 flat type makes colors "flash"
I'm trying to make a simple WebGL2 scene with low-poly terrain. Everything is working as expected when I let the shader interpolate between the three vertex colors. But as soon as I add the flat type ...
80
votes
11
answers
91k
views
.flat() is not a function, what's wrong?
The following code
function steamrollArray(arr) {
// I'm a steamroller, baby
return arr.flat();
}
steamrollArray([1, [2], [3, [[4]]]]);
returns
arr.flat is not a function
I tried it in Firefox ...