Documentation
¶
Overview ¶
Package json provides JSON reading and writing functionality for DataFrames.
Supports two orientations:
- "records": [{"col": val, ...}, ...] (default)
- "columns": {"col": [val, ...], ...}
Also supports JSONL format (one record per line).
Example:
// Read JSON
df, err := json.ReadJSON("data.json",
json.Orient("records"),
)
// Write JSON
err = json.WriteJSON(df, "output.json",
json.Orient("columns"),
)
// JSONL format
df, err := json.ReadJSON("data.jsonl", json.Lines())
Package json provides JSON reading and writing functionality for DataFrames.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ReadJSON ¶
func ReadJSON(path string, opts ...JSONOption) (*dataframe.DataFrame, error)
ReadJSON reads a JSON file and returns a DataFrame.
Types ¶
type JSONOption ¶
type JSONOption func(*JSONReader) error
JSONOption is a functional option for configuring JSONReader.
func Orient ¶
func Orient(format string) JSONOption
Orient sets the JSON format orientation. "records": [{"col": val, ...}, ...] "columns": {"col": [val, ...], ...}
type JSONReader ¶
type JSONReader struct {
// contains filtered or unexported fields
}
JSONReader reads JSON files into DataFrames.
type JSONWriter ¶
type JSONWriter struct {
// contains filtered or unexported fields
}
JSONWriter writes DataFrames to JSON files.
Click to show internal directories.
Click to hide internal directories.