Search Results
|
Post |
Author |
Forum |
Replies |
Views |
Posted
[asc]
|
|
|
Thread: facing issue in python
Post: RE: facing issue in python
using the code, the value am getting is something like below: -
test ,123,234,'BC','ADBC'
i want the data like below:-
test,123,BC
test,234,ADBC
i tried split function but that is also not working. |
|
rajrishi990 |
General Coding Help |
6 |
3,209 |
Nov-28-2019, 04:22 AM |
|
|
Thread: facing issue in python
Post: RE: facing issue in python
(Nov-27-2019, 05:25 PM)snippsat Wrote: >>> for item in data['applicationgroup'][0]['applicationRoles']:
... print(f"<{item['sid']}> has a type: {item['type']}")
...
<123&g... |
|
rajrishi990 |
General Coding Help |
6 |
3,209 |
Nov-27-2019, 05:44 PM |
|
|
Thread: facing issue in python
Post: RE: facing issue in python
valid json: -
{
"applicationgroup": [{
"name": "test",
"applicationRoles": [{
"sid": 123,
"type": "BC"
},
{
"sid": 234,
"type": "adBC"
}
],
"type": "tttt"
}]
} |
|
rajrishi990 |
General Coding Help |
6 |
3,209 |
Nov-27-2019, 04:29 PM |
|
|
Thread: facing issue in python
Post: facing issue in python
i have below json file. When i amtrying to pull sid and type from applicationRoles, i am able to pull only first entry i.e.sid=123 and type=BC but i need both entries
{
"applicationgroup":[
{
"name":"... |
|
rajrishi990 |
General Coding Help |
6 |
3,209 |
Nov-27-2019, 04:24 PM |
|
|
Thread: Need help in python scripting
Post: RE: Need help in python scripting
valid json: -
Output:{
"a": [{
"id": 1,
"name": "Auto",
"architecture": {
"axe": [
"j",
"y",
"r",
"t",
"x"
],
"p": [
"Vir",
"M"
]
},
"LL": [{
"id"... |
|
rajrishi990 |
General Coding Help |
17 |
5,783 |
Nov-27-2019, 09:28 AM |
|
|
Thread: Need help in python scripting
Post: RE: Need help in python scripting
Json file: -
{
"id": 1,
"name": "Auto",
"architecture": {
"axe": [
"j",
"y",
"r",
"t",
"x"
],
"p": [
... |
|
rajrishi990 |
General Coding Help |
17 |
5,783 |
Nov-27-2019, 09:12 AM |
|
|
Thread: Need help in python scripting
Post: RE: Need help in python scripting
i have object inside array and when i am trying to fecth details i am getting index error
row_array.append(json_d["axe"][0]["name"])error; -
IndexError: list index out of range |
|
rajrishi990 |
General Coding Help |
17 |
5,783 |
Nov-27-2019, 07:12 AM |
|
|
Thread: Need help in python scripting
Post: RE: Need help in python scripting
using below script i am getting error at multilevel. When i use get for x["salary"][0]["SID"] i get error in script
import json
import csv
with open('/local/dummy.json') as f:
json_data = json... |
|
rajrishi990 |
General Coding Help |
17 |
5,783 |
Nov-27-2019, 03:51 AM |
|
|
Thread: Need help in python scripting
Post: RE: Need help in python scripting
{
"a": [
{
"Id": 3,
"name": "I)",
"axe": [
{
"progr": 378
}
}
]
]
}
(Nov-26-2019, 03:23 P... |
|
rajrishi990 |
General Coding Help |
17 |
5,783 |
Nov-26-2019, 03:46 PM |
|
|
Thread: Need help in python scripting
Post: RE: Need help in python scripting
i have nested json inside json like below: -
[json]
<a>
<Id>3</Id>
<name>IT</name>
<axe>
<prog>
<progr>C#</progr>
</prog>
</axe>
[/js... |
|
rajrishi990 |
General Coding Help |
17 |
5,783 |
Nov-26-2019, 01:24 PM |
|
|
Thread: Need help in python scripting
Post: RE: Need help in python scripting
in my code if i use below
try:
row_array.append(json_d["test"]["aa"]["bb"])
except KeyError:
row_array.append('')i am getting below ... |
|
rajrishi990 |
General Coding Help |
17 |
5,783 |
Nov-26-2019, 12:32 PM |
|
|
Thread: Need help in python scripting
Post: RE: Need help in python scripting
i found solution but i am getting error in below one as key error:'ttt' if ttt is not available for one record
import sys
import json
import csv
reload(sys)
sys.setdefaultencoding('utf8')
with open('/... |
|
rajrishi990 |
General Coding Help |
17 |
5,783 |
Nov-26-2019, 09:35 AM |
|
|
Thread: Need help in python scripting
Post: RE: Need help in python scripting
i am using below script . i get values only for id and name and rest is blank.
import sys
import json
import csv
reload(sys)
sys.setdefaultencoding('utf8')
with open('/local/a.json','r') as f:
... |
|
rajrishi990 |
General Coding Help |
17 |
5,783 |
Nov-26-2019, 06:25 AM |
|
|
Thread: Need help in python scripting
Post: Need help in python scripting
I am new to python
I have below json file and i need to convert it to csv and pull only selected columns in csv.Selected columns will be id,SID,Type,ttt,S.
I am unable to figure out solution. PLease h... |
|
rajrishi990 |
General Coding Help |
17 |
5,783 |
Nov-25-2019, 02:13 PM |