All Questions
54 questions
0
votes
1
answer
244
views
flatten a complex dict, while compressing keys using dot as a separator
I'm trying come up with a python3 function (using existing libs also works, of course) that would flatten this input:
{
'key1': 1,
'key2dict': {'subkey1': 1, 'subkey2': 2},
'key3listOfDict': [
...
2
votes
1
answer
387
views
Flatten nested xml using xslt
I am facing challenging to flatten a nested xml file using xslt.
Input xml:
<?xml version="1.0" encoding="UTF-8"?>
<group xmlns="http://group.com/group">
&...
0
votes
3
answers
1k
views
Flatten the nested dictionary, which has list also, into a dictionary
I have a nested dictionary with a list inside of it such as
{'Ka': {'Ka': ['0.80', '0.1'],
'Ba': ['0.50', '1.1'],
'FC': ['0.78', '0.0'],
'AA': ['0.66', '8.1']},
'AL': {'AR': ['2.71', '7.3'], '...
0
votes
1
answer
65
views
Python: Convert Nested Array to Newly Formatted Nested Array Based on Column Position [duplicate]
Let's say I have a nested array like so:
array = [[1,7], [49, 9], [3, 80], [13, 15]]
From the above array, I want to create two new arrays (within a nested array) based on vertical "columns"...
0
votes
0
answers
131
views
Flattening list of dicts columns from a converted Json file to Dataframe
I'm trying to convert a Json file to a Dataframe using Pandas and json_normalize. The json file is like this:
enter image description here
Then my Dataframe is like this after reading the file and ...
0
votes
0
answers
86
views
Python flattening json to long, not wide - with nested lists and nested jsons
I've tried flattening with pandas df = pd.DataFrame([flatten_json(data[key]) for key in data.keys()])
but get a single row of wide data.
I need long data while preserving the values of some higher ...
1
vote
1
answer
120
views
How to flatten this Dataframe
I have Dataframe that consists of ID and one column. That column has list of dictionaries in each cell. What I want is normalize it and flatten, so instead of having one column, I will have many of ...
1
vote
1
answer
837
views
Flatten and sort a nested JSON object into an array in javascript
I have an object like:
{
'2021': {
'08': {
'26': [{'name': 'Bob', age: 34}, {'name': 'Alice', age: 33}],
'27': [{'name': 'Jane', age: 21}]
},
'09': {
'03': [{'name': '...
0
votes
2
answers
1k
views
Flatten nested JSON object
I have a json object like this:
const people = {
name: 'My Name',
cities: [{city: 'London', country: 'UK'},{city: 'Mumbai', country: 'IN'},{city: 'New York', country: 'US'}],
}
I would like the ...
0
votes
1
answer
275
views
Parse nested JSON and iterate into Pandas Dataframe
I'm using a Foursquare API call to find venues associated with particular ZIP codes in the US.
I am able to generate the JSON with information, but am having trouble looping and parsing to construct a ...
0
votes
2
answers
307
views
pandas: how to remove duplicates from a deeply nested list of lists
I have a panda dataframe like the following:
df = pd.DataFrame({ 'text':['the weather is nice though', 'How are you today','the beautiful girl and the nice boy']})
df['sentence_number'] = df.index + 1
...
0
votes
2
answers
412
views
Flatten JSON / Dictionaries / List
I have a nested JSON
{
"ID": 300,
"Name": " TEST",
"Value": [
{
"Details": [
{
&...
0
votes
2
answers
753
views
Parse multiple json files, flatten data and save as json
I have multiple number of json files saved in a folder. I would like to parse each json file, use the library flatten and save as a seperate json file.
I have managed to do this with one json, but ...
4
votes
2
answers
286
views
Generify transformation of hierarchical array into a flat array
I'm trying to generify the transformation of a hierarchical array into a flat array.
I have this kind of object which has children of the same type, which has children of the same type etc..
[{
...
3
votes
3
answers
2k
views
Extract set of leaf values found in nested dicts and lists excluding None
I have a nested structure read from YAML which is composed of nested lists and/or nested dicts or a mix of both at various levels of nesting. It can be assumed that the structure doesn't contain any ...