Questions tagged [jsonlines]

JSON Lines is a format for storing structured data that may be processed one record at a time. It is a convenient format for storing structured data that may be processed one record at a time. It works well with Unix-style text processing tools and shell pipelines.

This text format is documented at http://jsonlines.org/.

156 questions
0
votes
0 answers

How to write JSONL for Vertex AI to make batch prediction without coding

I have built model and deployed it for text classification on Vertex AI. I am not expert in coding so I want to utilize the friendly interface which is offered by google. The problem I have to uploade each text which I need to predict as seperate…
0
votes
1 answer

Load a from a text file containing multiple JSONs into Python

I have a text file temp.txt of the sort -- { "names" : [ {"index" : 0, "cards": "\n\nbingo" ...} ] "more stuff": ... } { "names" : [ {"index" : 0, "cards": "\nfalse" ...} ] "more stuff": ... } . . Here's how I am trying to load it -- def…
Rahul Dev
  • 602
  • 1
  • 6
  • 16
0
votes
1 answer

using sklearn KMeans with initial centroids without fitting model

I have fitted a KMeans model and retrived the centroid for the data. Is there any way that I can use the predict() function using these centroids to initalise the KMeans model but without calling the fit function I tried to run the following code…
Aman Rai
  • 19
  • 6
0
votes
0 answers

How to convert jsonl to json in python

I am looking for a way to convert a JSONL file to JSON. I have written a python program but at some point it's just getting to slow because the JSON file gets to big. And with every loop I checked if the keys are in there… Maybe some of you has an…
0
votes
1 answer

What is the official way to save list of dictionaries as jsonl or json lines?

What is the official way to save list of dictionaries and jsonl or json lines? I saw: https://ml-gis-service.com/index.php/2022/04/27/toolbox-python-list-of-dicts-to-jsonl-json-lines/ with solution: import gzip import json def…
Charlie Parker
  • 5,884
  • 57
  • 198
  • 323
0
votes
1 answer

Transform a large jsonl file with unknown json properties into csv using apache beam google dataflow and java

How to convert a large jsonl file with unknown json properties into csv using Apache Beam, google dataflow and java Here is my scenario: A large jsonl file is in google storage Json properties are unknown, so using Apache Beam's Schema can not be…
Ash
  • 2,095
  • 1
  • 19
  • 17
0
votes
0 answers

How can I open a JSONL file in DBeaver

I am using DBeaver 22.0.5, and when I try to open a jsonl (json lines formnat) file, I get an "unsupported command" error. My objective is to open the jsonl file and to run some SQL commands to unnest the data in the file and put it a useful table…
saddas
  • 65
  • 7
0
votes
0 answers

Parsing jsonlines column into datafarme in R results in trailing garbage error

I have a dataframe where one of the columns is in jsonlines format (I think) and i can't manage to parse it and have tried a few different methods but end up with a trailing garbage error. Has anyone dealt with this before? I'm not sure why it isn't…
Hayden
  • 107
  • 8
0
votes
1 answer

Convert nested data to json without square brackets

I want to upload ndjson files with nested data. My code (see below) results in > {"id":284,"attributes":[{"value":{"T3":1,"T4":0}}]} > {"id":848,"attributes":[{"value":{"T3":2,"T4":0}}]} Uploading this data leads to the following error: Bad…
qwertzuiop
  • 172
  • 8
0
votes
1 answer

PYTHON: reading .jl file using jsonlines is resulting in line of json. I need all the json lines

I am trying to read the file from the path and add to the dictionary, however, i end up with first json-line and there are about 230MB of data. I have folder like here # folder path folder =…
vivek
  • 3
  • 4
0
votes
2 answers

I need to transform the jsonline to df

Below is the example of my jsonline data {"allocation":{"duration":1,"rewards":[{"expiryDate":"2021-01-01 23:59:59","rewardSubType":"Boxes"}]},"MODULE":"a","APPLICATION":"g","GUID2":"gh-gh-gh","METHOD":"Expensive","timestamp":"2021-01-01…
Byron Fox
  • 3
  • 3
0
votes
3 answers

Read JSON Lines file as String in Python

I have a JSON Lines file that I would like to read as a string in Python. The file contains multiple JSON objects in this format: {"Data1": "Value1"} {"Data2": "Value2"} {"Data3": "Value3"} I tried the following code in Python but it returned an…
elideli
  • 179
  • 3
  • 15
0
votes
3 answers

Is there a better way to get (key,itemN) tuples for python dictionary that has a list as a value?

I have a file of jsonlines that contains items with node as the key and as a value a list of the other nodes it is connected to. To add the edges to a networkx graph, -I think- requires tuples of the form(u,v). I wrote a naive solution for this but…
MiltosV
  • 3
  • 2
0
votes
1 answer

Shopify bulk query results parsing

I am working on a shopify integration, and I am trying to perform some bulk queries which return data in jsonl format. I read carefully the documentation, and I understood which is the principle behind this format, but there is one thing I don't…
Apperside
  • 3,542
  • 2
  • 38
  • 65
0
votes
0 answers

How to parse a JSON file into jsonlines with python for GPT-3 fine-tuning

I'm trying to parse a json data file into jsonl for GPT-3 fine-tuning. I'm specifically trying to find out how to merge contents from the same Author ID. Where user 123 is prompt and user 456 is completion. The data: { "messages": [ { …
Dispay
  • 1
  • 1