How do I load multiple JSONs file into a single DataFrames in Julia?

Viewed 58
using JSON3
using DataFrames 
ls = ["j1.json",j2.json","j3.json"]   
df = JSON3.read.(eachline(ls)) |> DataFrame

How would I do this when I have several json files?. Can i merge all the json files into a single data-frame without using any loops in Julia

1 Answers

You can try

using JSON3
using DataFrames 
ls = filter(endswith("json"),readdir("."))
df = JSON3.read.(read.(ls,String)) |> DataFrame
Related