I would like to translate the field "text" from the flight domain of the Taskmaster-2 dataset. Which is a deeply nested JSON file. Using Google Cloud Translate how can I do it?
Example (from English to Bangla):
Origin JSON file:
[ {
"conversation_id": "dlg-00100680-00e0-40fe-8321-6d81b21bfc4f",
"instruction_id": "flight-12",
"utterances": [
{
"index": 0,
"speaker": "USER",
"text": "Hello. I'd like to find a round trip commercial airline flight from San Francisco to Denver.",
"segments": [
{
"start_index": 26,
"end_index": 36,
"text": "round trip",
"annotations": [
{
"name": "flight_search.type"
}
]
},
Output JSON file:
[ {
"conversation_id": "dlg-00100680-00e0-40fe-8321-6d81b21bfc4f",
"instruction_id": "flight-12",
"utterances": [
{
"index": 0,
"speaker": "USER",
"text": "হ্যালো. আমি সান ফ্রান্সিসকো থেকে ডেনভার পর্যন্ত একটি রাউন্ড ট্রিপ বাণিজ্যিক এয়ারলাইন ফ্লাইট খুঁজতে চাই।",
"segments": [
{
"start_index": 26,
"end_index": 36,
"text": "রাউন্ড ট্রিপ",
"annotations": [
{
"name": "flight_search.type"
}
]
},
I extracted a few lines of data in flights.json and used the code below written in Python using Google Cloud Translation API to translate English to Japanese. Also see list of supported languages of the API.
test.json:
[
{
"conversation_id": "dlg-00100680-00e0-40fe-8321-6d81b21bfc4f",
"instruction_id": "flight-12",
"utterances": [
{
"index": 0,
"speaker": "USER",
"text": "Hello. I'd like to find a round trip commercial airline flight from San Francisco to Denver.",
"segments": [
{
"start_index": 26,
"end_index": 36,
"text": "round trip",
"annotations": [
{
"name": "flight_search.type"
}
]
},
{
"start_index": 68,
"end_index": 81,
"text": "San Francisco",
"annotations": [
{
"name": "flight_search.origin"
}
]
},
{
"start_index": 85,
"end_index": 91,
"text": "Denver",
"annotations": [
{
"name": "flight_search.destination1"
}
]
}
]
},
{
"index": 1,
"speaker": "ASSISTANT",
"text": "Hello, how can I help you?"
},
{
"index": 2,
"speaker": "ASSISTANT",
"text": "San Francisco to Denver, got it.",
"segments": [
{
"start_index": 0,
"end_index": 13,
"text": "San Francisco",
"annotations": [
{
"name": "flight_search.origin"
}
]
},
{
"start_index": 17,
"end_index": 23,
"text": "Denver",
"annotations": [
{
"name": "flight_search.destination1"
}
]
}
]
}
]
}
]
Code:
import json
from google.cloud import translate_v2 as translate
f = open('test.json')
data = json.load(f)
target = "ja"
translate_client = translate.Client()
for conv in data:
for utt in conv["utterances"]:
utt["text"] = translate_client.translate(utt["text"], target_language=target)["translatedText"]
if "segments" in utt:
for seg in utt["segments"]:
seg["text"] = translate_client.translate(seg["text"], target_language=target)["translatedText"]
#print(data) # prints a dictionary
json_object = json.dumps(data, indent=2,ensure_ascii=False).encode('utf8')
print(json_object.decode()) # prints a json string
Output:
[
{
"conversation_id": "dlg-00100680-00e0-40fe-8321-6d81b21bfc4f",
"instruction_id": "flight-12",
"utterances": [
{
"index": 0,
"speaker": "USER",
"text": "こんにちは。サンフランシスコからデンバーまでの民間航空会社の往復便を探したいのですが。",
"segments": [
{
"start_index": 26,
"end_index": 36,
"text": "往復",
"annotations": [
{
"name": "flight_search.type"
}
]
},
{
"start_index": 68,
"end_index": 81,
"text": "サンフランシスコ",
"annotations": [
{
"name": "flight_search.origin"
}
]
},
{
"start_index": 85,
"end_index": 91,
"text": "デンバー",
"annotations": [
{
"name": "flight_search.destination1"
}
]
}
]
},
{ "index": 1,
"speaker": "ASSISTANT",
"text": "こんにちは、どうすればいいですか?"
},
{
"index": 2,
"speaker": "ASSISTANT",
"text": "サンフランシスコからデンバーへ、了解。",
"segments": [
{
"start_index": 0,
"end_index": 13,
"text": "サンフランシスコ",
"annotations": [
{
"name": "flight_search.origin"
}
]
},
{
"start_index": 17,
"end_index": 23,
"text": "デンバー",
"annotations": [
{
"name": "flight_search.destination1"
}
]
}
]
}
]
}
]
Related
i have a question:
Is it possible read a json file and convert to dataframe dynamically?
My example is the next code:
Having this json file, i need 3 table dataframes:
{
"date_time": "01-03-2022, 15:18:32",
"regions": {
"Home Region": "Madrid",
"Primary Region": "Barcelona",
"Secondary Region": "Rio"
},
"customers": [
{
"name": "campo santo",
"address": "rua trebal 1",
"phone": 987456321,
"parking": true
},
{
"name": "santo da silva",
"address": "rua sama 6",
"phone": 654321987,
"parking": false
},
{
"name": "roger campos",
"address": "av casal 10",
"phone": 684426654,
"parking": true
}
],
"office": [
{
"location": "madrid",
"co_working_spaces": 25,
"kitchen": false,
"food_track": 2,
"internal_staff": [
{
"id": 123,
"name": "pablo"
},
{
"id": 874,
"name": "saul"
},
{
"id": 741,
"name": "maria"
}
]
},
{
"location": "rio",
"co_working_spaces": 55,
"kitchen": true,
"food_track": 4,
"internal_staff": [
{
"id": 784,
"name": "raquel"
},
{
"id": 874,
"name": "pedro"
},
{
"id": 145,
"name": "maria"
},
{
"id": 365,
"name": "rocio"
}
]
},
{
"location": "barcelona",
"co_working_spaces": 5,
"kitchen": false,
"food_track": 1,
"internal_staff": [
]
},
{
"location": "la",
"co_working_spaces": 5,
"kitchen": true,
"food_track": 4,
"internal_staff": [
{
"id": 852,
"name": "maria"
},
{
"id": 748,
"name": "sara"
}
]
}
]
}
this is my python code:
import pandas as pd
# from pandas.io.json import json_normalize
import json
with open('offices.json') as f:
dt = json.load(f)
# df = pd.json_normalize(dt)
df1 = pd.json_normalize(dt, 'customers', 'date_time')[['name', 'address', 'phone', 'parking', 'date_time']]
print(df1)
df2 = pd.json_normalize(dt, 'office', 'date_time')[['location', 'co_working_spaces', 'kitchen', 'food_track']]
print(df2)
df3 = pd.json_normalize(dt['office'], 'internal_staff', 'location')
print(df3)
With this code, i got my 3 table dataframes. But i have to know the json structure to create the dataframes.
So is it possible to do it dynamically ?
Regards
I've taken the following JSON example directly from Twitter's API example using Postman, my question is how would I be able to grab each tweets inside the "data" section and add each individual tweet onto a List < String > so that each individual tweet's sub JSON is saved as String in the List. Would this be possible? I was attempting to use the JSON parsing method decoding and encoding from Dart but that did not work, I'm not sure if its because the JSON example features the "data" section and the "errors" section. Any help would be greatly appreciated, thank you!
Example JSON:
{
"data": [
{
"author_id": "12",
"conversation_id": "20",
"created_at": "2006-03-21T20:50:14.000Z",
"id": "20",
"text": "just setting up my twttr"
},
{
"attachments": {
"media_keys": [
"16_1276500934466703361"
]
},
"author_id": "783214",
"conversation_id": "1275244210439028736",
"created_at": "2020-06-23T01:48:07.000Z",
"entities": {
"urls": [
{
"start": 112,
"end": 135,
"url": "https://twitter.com/Twitter/status/1275244210439028736/photo/1",
"expanded_url": "https://twitter.com/Twitter/status/1275244210439028736/photo/1",
"display_url": "pic.twitter.com/dpI2lRmj9F"
}
]
},
"id": "1275244210439028736",
"text": "Need to follow what’s happening in real time? Change your timeline to show latest Tweets instead of top Tweets."
},
{
"attachments": {
"media_keys": [
"3_1274087263073255425"
]
},
"author_id": "783214",
"conversation_id": "1274087687469715457",
"created_at": "2020-06-19T21:12:32.000Z",
"entities": {
"mentions": [
{
"start": 13,
"end": 22,
"username": "YoliZama"
}
],
"urls": [
{
"start": 23,
"end": 46,
"url": "https://twitter.com/Twitter/status/1274087695145332736/photo/1",
"expanded_url": "https://twitter.com/Twitter/status/1274087695145332736/photo/1",
"display_url": "pic.twitter.com/lcGDLzAJIn"
}
]
},
"id": "1274087695145332736",
"referenced_tweets": [
{
"type": "replied_to",
"id": "1274087694105075714"
}
],
"text": "📍 Oakland\n🗣️ #YoliZama"
},
{
"attachments": {
"media_keys": [
"3_1274086977952833536"
]
},
"author_id": "783214",
"conversation_id": "1274087687469715457",
"created_at": "2020-06-19T21:12:32.000Z",
"entities": {
"mentions": [
{
"start": 19,
"end": 31,
"username": "Afrikkana95"
}
],
"urls": [
{
"start": 32,
"end": 55,
"url": "https://twitter.com/Twitter/status/1274087694105075714/photo/1",
"expanded_url": "https://twitter.com/Twitter/status/1274087694105075714/photo/1",
"display_url": "pic.twitter.com/tEfs27p7xu"
}
]
},
"id": "1274087694105075714",
"referenced_tweets": [
{
"type": "replied_to",
"id": "1274087692003770368"
}
],
"text": "📍 New York City\n🗣️ #Afrikkana95"
},
{
"attachments": {
"media_keys": [
"3_1274086862907305984"
]
},
"author_id": "783214",
"conversation_id": "1274087687469715457",
"created_at": "2020-06-19T21:12:31.000Z",
"entities": {
"mentions": [
{
"start": 13,
"end": 25,
"username": "JoshuaKissi"
}
],
"urls": [
{
"start": 26,
"end": 49,
"url": "https://twitter.com/Twitter/status/1274087692003770368/photo/1",
"expanded_url": "https://twitter.com/Twitter/status/1274087692003770368/photo/1",
"display_url": "pic.twitter.com/ZeD3XvJUbX"
}
]
},
"id": "1274087692003770368",
"referenced_tweets": [
{
"type": "replied_to",
"id": "1274087690758090752"
}
],
"text": "📍 Chicago\n🗣️ #JoshuaKissi"
},
{
"attachments": {
"media_keys": [
"3_1274086703272038401"
]
},
"author_id": "783214",
"conversation_id": "1274087687469715457",
"created_at": "2020-06-19T21:12:31.000Z",
"entities": {
"mentions": [
{
"start": 18,
"end": 33,
"username": "Imani_Barbarin"
}
],
"urls": [
{
"start": 34,
"end": 57,
"url": "https://twitter.com/Twitter/status/1274087690758090752/photo/1",
"display_url": "pic.twitter.com/ZRDUipsu38",
"expanded_url": "https://twitter.com/Twitter/status/1274087690758090752/photo/1",
"display_url": "pic.twitter.com/ZRDUipsu38"
}
]
},
"id": "1274087690758090752",
"referenced_tweets": [
{
"type": "replied_to",
"id": "1274087689487134720"
}
],
"text": "📍 Philadelphia\n🗣️ #Imani_Barbarin "
},
{
"attachments": {
"media_keys": [
"3_1274086530919718917"
]
},
"author_id": "783214",
"conversation_id": "1274087687469715457",
"created_at": "2020-06-19T21:12:30.000Z",
"entities": {
"mentions": [
{
"start": 13,
"end": 25,
"username": "BerniceKing"
}
],
"urls": [
{
"start": 26,
"end": 49,
"url": "https://twitter.com/Twitter/status/1274087688321200128/photo/1",
"expanded_url": "https://twitter.com/Twitter/status/1274087688321200128/photo/1",
"display_url": "pic.twitter.com/83upyVnwIS"
}
]
},
"id": "1274087688321200128",
"referenced_tweets": [
{
"type": "replied_to",
"id": "1274087687469715457"
}
],
"text": "📍 Atlanta\n🗣️ #BerniceKing "
},
{
"attachments": {
"media_keys": [
"3_1274086027544498176"
]
},
"author_id": "783214",
"conversation_id": "1274087687469715457",
"created_at": "2020-06-19T21:12:30.000Z",
"entities": {
"mentions": [
{
"start": 17,
"end": 29,
"username": "FredTJoseph"
}
],
"urls": [
{
"start": 30,
"end": 53,
"url": "https://twitter.com/Twitter/status/1274087687469715457/photo/1",
"expanded_url": "https://twitter.com/Twitter/status/1274087687469715457/photo/1",
"display_url": "pic.twitter.com/lNTOkyguG1"
}
]
},
"id": "1274087687469715457",
"text": "📍 Minneapolis\n🗣️ #FredTJoseph"
},
{
"author_id": "783214",
"conversation_id": "1274034244700930049",
"created_at": "2020-06-19T17:40:09.000Z",
"entities": {
"hashtags": [
{
"start": 106,
"end": 115,
"tag": "BlackJoy"
}
],
"mentions": [
{
"start": 3,
"end": 14,
"username": "Blackbirds"
}
]
},
"id": "1274034244700930049",
"referenced_tweets": [
{
"type": "retweeted",
"id": "1274014870707437570"
}
],
"text": "RT #Blackbirds: Juneteenth is a celebration. It’s about our freedom. And within that freedom is our joy.\n\n#BlackJoy is a form of resistance…"
},
{
"author_id": "773578328498372608",
"conversation_id": "1275473478779469825",
"created_at": "2020-06-23T16:59:09.000Z",
"entities": {
"mentions": [
{
"start": 3,
"end": 10,
"username": "Policy"
}
]
},
"id": "1275473478779469825",
"referenced_tweets": [
{
"type": "retweeted",
"id": "1275192966953476100"
}
],
"text": "RT #Policy: Statement on US high-skilled immigration proclamation: \n\n\"This proclamation undermines America’s greatest economic asset: its d…"
}
],
"errors": [
{
"detail": "Could not find tweet with ids: [1276230436478386177].",
"title": "Not Found Error",
"resource_type": "tweet",
"parameter": "ids",
"value": "1276230436478386177",
"type": "https://api.twitter.com/2/problems/resource-not-found"
}
]
}
Output: List < String > where one element in the list could look like this:
{
"attachments": {
"media_keys": [
"16_1276500934466703361"
]
},
"author_id": "783214",
"conversation_id": "1275244210439028736",
"created_at": "2020-06-23T01:48:07.000Z",
"entities": {
"urls": [
{
"start": 112,
"end": 135,
"url": "https://twitter.com/Twitter/status/1275244210439028736/photo/1",
"expanded_url": "https://twitter.com/Twitter/status/1275244210439028736/photo/1",
"display_url": "pic.twitter.com/dpI2lRmj9F"
}
]
},
"id": "1275244210439028736",
"text": "Need to follow what’s happening in real time? Change your timeline to show latest Tweets instead of top Tweets."
},
It would essentially grab one whole tweet's subJson and save it onto the List. This goes hand in hand with an issue I was facing a few days back concerning this problem , but I think the problem is that the JSON response I get back using the HTTP library is not able to be added properly onto a List.
List<Map<String, dynamic>> jsonRes =
(inputMap['data'] as List<Map>).map((t) => {
if (t.containsKey('attachments')) 'attachments': t['attachments'],
if (t.containsKey('author_id')) 'author_id': t['author_id'],
if (t.containsKey('conversation_id')) 'conversation_id': t['conversation_id'],
if (t.containsKey('created_at')) 'created_at': t['created_at'],
if (t.containsKey('entities')) 'entities': t['entities'],
if (t.containsKey('id')) 'id': t['id'],
if (t.containsKey('text')) 'text': t['text'],
}).toList();
List<String> stringRes = jsonRes.map((e) => jsonEncode(e)).toList();
Alternatively:
final List<String> wantedKeys = [
'attachments',
'author_id',
'conversation_id',
'created_at',
'entities',
'id',
'text'
];
List<Map<String, dynamic>> jsonRes = (inputMap['data']
as List<Map<String, dynamic>>)
.map((m) => Map.fromEntries(m.entries.where((e) => wantedKeys.contains(e.key))))
.toList();
List<String> stringRes = jsonRes.map((e) => jsonEncode(e)).toList();
I have hapi.js, sequelize with mysql with script like this :
method: 'GET',
path: `/${GROUP_NAME}`,
options: {
tags: ['api', GROUP_NAME],
description: 'Mendapatkan jumlah tempat tidur berdasarkan kelas',
notes: 'Mendapatkan jumlah tempat tidur',
handler: async (request, h) => {
return jlhttidurbyjenis.findAll({ attributes: ['VIP','KELAS 1','KELAS 2','KELAS 3','ICU','NICU','PICU','HCU','ICCU','ISOLASI']})
},
validate: {
},
response: {
}
}
when I test with postman it response like this :
[
{
"VIP": {
"type": "Buffer",
"data": [
50,
47,
50,
50
]
},
"KELAS 1": {
"type": "Buffer",
"data": [
48,
47,
48
]
},
"KELAS 2": {
"type": "Buffer",
"data": [
48,
47,
48
]
},
"KELAS 3": {
"type": "Buffer",
"data": [
48,
47,
48
]
},
"ICU": {
"type": "Buffer",
"data": [
48,
47,
48
]
},
"NICU": {
"type": "Buffer",
"data": [
48,
47,
48
]
},
"PICU": {
"type": "Buffer",
"data": [
48,
47,
48
]
},
"HCU": {
"type": "Buffer",
"data": [
48,
47,
48
]
},
"ICCU": {
"type": "Buffer",
"data": [
48,
47,
48
]
},
"ISOLASI": {
"type": "Buffer",
"data": [
48,
47,
48
]
}
}
]
How to fix the script so the response will be the same with database content, it will be like this :
[
{
"VIP": "12/22",
"KELAS 1": "0/0",
"KELAS 2": "0/0",
"KELAS 3": "0/0",
"ICU": "0/0",
"NICU": "0/0",
"PICU": "0/0",
"HCU": "0/0",
"ICCU": "0/0",
"ISOLASI": "0/0"
}
]
That looks like a serialization issue from sequilize. Look at available configurations for JSON serialization with regards to buffer.
Is it possible to modify/replace array elements while grouping by a specific key (.[].Parameter.Id) such that this array:
[{
"Id": 48,
"Parameter": {
"Id": 17
}
}, {
"Id": 196,
"Parameter": {
"Id": 17
}
}]
becomes this:
[
{
"p17": [48, 196]
}
]
Here is the source JSON file for a complete example:
[{
"Id": 78,
"PromotionType": 2,
"Amount": "100",
"UpperLimit": null,
"Variables": [{
"Id": 100,
"Parameter": {
"Id": 30
}
}]
}, {
"Id": 84,
"PromotionType": 2,
"Amount": null,
"UpperLimit": null,
"Variables": [{
"Id": 48,
"Parameter": {
"Id": 17
}
}, {
"Id": 196,
"Parameter": {
"Id": 17
}
}, {
"Id": 59,
"Parameter": {
"Id": 21
}
}, {
"Id": 60,
"Parameter": {
"Id": 21
}
}, {
"Id": 62,
"Parameter": {
"Id": 21
}
}]
}, {
"Id": 59,
"PromotionType": 2,
"Amount": "666.6",
"UpperLimit": null,
"Variables": [{
"Id": 96,
"Parameter": {
"Id": 8
}
}, {
"Id": 47,
"Parameter": {
"Id": 17
}
}]
}]
What I want to achieve is this:
[{
"Id": 78,
"PromotionType": 2,
"Amount": "100",
"UpperLimit": null,
"Variables": [{
"p30": [100]
}]
}, {
"Id": 84,
"PromotionType": 2,
"Amount": null,
"UpperLimit": null,
"Variables": [{
"p17": [48, 196]
}, {
"p21": [59, 60, 62]
}]
}, {
"Id": 59,
"PromotionType": 2,
"Amount": "666.6",
"UpperLimit": null,
"Variables": [{
"p8": [96]
}, {
"p17": [47]
}]
}]
I am reading through jq manual, jq cookbook and found some functions (e.g. with_entries, unique_by, inputs) that might help but could not figure out how to make it work.
Number of objects/inner objects are also not fixed. So I cannot simply replace using array indexes.
Any help would be appreciated.
Thanks,
Emre
jq solution:
jq 'map(.Variables
|= (group_by(.Parameter.Id)
| map(("p" + (.[0].Parameter.Id | tostring)) as $pid
| { ($pid) : map(.Id) }
)
)
)' input.json
The output:
[
{
"Id": 78,
"PromotionType": 2,
"Amount": "100",
"UpperLimit": null,
"Variables": [
{
"p30": [
100
]
}
]
},
{
"Id": 84,
"PromotionType": 2,
"Amount": null,
"UpperLimit": null,
"Variables": [
{
"p17": [
48,
196
]
},
{
"p21": [
59,
60,
62
]
}
]
},
{
"Id": 59,
"PromotionType": 2,
"Amount": "666.6",
"UpperLimit": null,
"Variables": [
{
"p8": [
96
]
},
{
"p17": [
47
]
}
]
}
]
I'm working on some code in which uses dynamic variables jsonResponse .
dynamic jsonResponse = JsonConvert.DeserializeObject(response);
This variable contains collection of hotel list in json format. From this collection I am getting roomlist collection in a new variable roomResponseList :
var roomResponseList = jsonResponse["hotels"]["hotels"][rooms].roomResponseList;
I am getting first room detail into **JObject responseRateKeys **:
foreach (var roomByResponse in roomResponseList)
{
JObject responseRateKeys = JObject.Parse(roomByResponse.ToString());
var boardNameListByResponse = responseRateKeys.AsJEnumerable().AsEnumerable()
.Select(t => t["rates"]["boardName"].ToString().Trim())
.Distinct()
.ToList();
}
But when I am trying to get any item list from JObject by using linq lambda, I am getting error,
"Cannot access child value on Newtonsoft.Json.Linq.JProperty."
Value of roomByResponse=
{ "code": "DBL.KG-NM", "name": "DOUBLE KING BED NON SMOKING", "rates": [ { "rateKey": "20171217|20171219|W|256|237403|DBL.KG-NM|ID_B2B_26|RO|IWH25|1~1~0||N#AFF5C93E36054661ADCBC14A78A532AE1007", "rateClass": "NRF", "rateType": "RECHECK", "net": "186.04", "allotment": 99, "paymentType": "AT_WEB", "packaging": false, "boardCode": "RO", "boardName": "ROOM ONLY", "cancellationPolicies": [ { "amount": "149.63", "from": "2017-07-14T03:29:00+05:30" } ], "rooms": 1, "adults": 1, "children": 0, "dailyRates": [ { "offset": 1, "dailyNet": "93.02" }, { "offset": 2, "dailyNet": "93.02" } ] }, { "rateKey": "20171217|20171219|W|256|237403|DBL.KG-NM|ID_B2B_26|BB|IWB25|1~1~0||N#AFF5C93E36054661ADCBC14A78A532AE1007", "rateClass": "NOR", "rateType": "RECHECK", "net": "238.92", "allotment": 99, "paymentType": "AT_WEB", "packaging": false, "boardCode": "BB", "boardName": "BED AND BREAKFAST", "rooms": 1, "adults": 1, "children": 0, "dailyRates": [ { "offset": 1, "dailyNet": "119.46" }, { "offset": 2, "dailyNet": "119.46" } ] }, { "rateKey": "20171217|20171219|W|256|237403|DBL.KG-NM|ID_B2B_26|RO|IWH25|2~2~1|2|N#AFF5C93E36054661ADCBC14A78A532AE1007", "rateClass": "NRF", "rateType": "RECHECK", "net": "372.06", "allotment": 99, "paymentType": "AT_WEB", "packaging": false, "boardCode": "RO", "boardName": "ROOM ONLY", "cancellationPolicies": [ { "amount": "299.25", "from": "2017-07-14T03:29:00+05:30" } ], "rooms": 2, "adults": 2, "children": 1, "childrenAges": "2", "dailyRates": [ { "offset": 1, "dailyNet": "186.03" }, { "offset": 2, "dailyNet": "186.03" } ] }, { "rateKey": "20171217|20171219|W|256|237403|DBL.KG-NM|ID_B2B_26|BB|IWB25|2~2~1|2|N#AFF5C93E36054661ADCBC14A78A532AE1007", "rateClass": "NOR", "rateType": "RECHECK", "net": "477.84", "allotment": 99, "paymentType": "AT_WEB", "packaging": false, "boardCode": "BB", "boardName": "BED AND BREAKFAST", "rooms": 2, "adults": 2, "children": 1, "childrenAges": "2", "dailyRates": [ { "offset": 1, "dailyNet": "238.92" }, { "offset": 2, "dailyNet": "238.92" } ] } ] }
Thank you
Pravesh Singh
change linq to
responseRateKeys["rates"].AsJEnumerable().Select(t=>t["boardName"]).Distinct().ToList()