{
"cells": [
{
"cell_type": "markdown",
"id": "45cde72d",
"metadata": {},
"source": [
"(guide/dataframe/io)=\n",
"\n",
"# I/O\n",
"\n",
"In this guide, we will discuss how to bring data into Meerkat from various file formats and external libraries. We will also discuss how to export data in Meerkat DataFrames back into these formats. Finally, we'll also discuss how to persist Meerkat DataFrames using {func}`~meerkat.DataFrame.write` and {func}`~meerkat.DataFrame.read`.\n",
"\n",
"```{admonition} Should I export or persist?\n",
"\n",
"This guide discusses two different ways of saving data in Meerkat: exporting and persisting.\n",
"They serve different purposes:\n",
"1. **Export** your DataFrame to another format using one of the `to_*` methods if you need to use the data with other libraries or tools. (See the section on {ref}`exporting`.)\n",
"2. **Persist** your DataFrame using {func}`~meerkat.DataFrame.write` if you simply want to save it to disk for later use. (See the section on {ref}`persisting`.)\n",
"```\n",
"\n",
"\n",
"```{contents}\n",
":local:\n",
"```\n",
"\n",
"## Importing DataFrames\n",
"\n",
"Meerkat has a number of built-in functions for reading in data from various file formats and Python libraries. \n",
"We'll provide one in depth example for reading in data from a CSV file, and then provide a list of the other supported file formats and libraries.\n",
"\n",
"### *Example*: Importing a dataset from CSV\n",
"\n",
"Let's load a CSV file from disk and read it into a Meerkat DataFrame. \n",
"We will be using a small sample of data from the [National Gallery of Art Open Data Program](https://github.com/NationalGalleryOfArt/opendata). We've included this data at `_data/art_ngoa.csv` in the Meerkat repository.\n",
"\n",
"We will use the {func}`~meerkat.from_csv` function to read in the data."
]
},
{
"cell_type": "code",
"execution_count": 1,
"id": "b869e9f3",
"metadata": {
"tags": [
"output_scroll"
]
},
"outputs": [
{
"data": {
"text/html": [
"
\n",
" \n",
" \n",
" | \n",
" title | \n",
" attribution | \n",
" medium | \n",
" objectid | \n",
" iiifthumburl | \n",
"
\n",
" \n",
" \n",
" \n",
" 0 | \n",
" Boy with Cat | \n",
" Ernst Ludwig Kirchner | \n",
" lithograph on yellow wove paper | \n",
" 103631 | \n",
" https://api.nga.gov/iiif/b309afc0-b270-4c29-9ce7-e8f39125f40d/full/!200,200/0/default.jpg | \n",
"
\n",
" \n",
" 1 | \n",
" A Hound Chasing a Hare | \n",
" Benozzo Gozzoli | \n",
" pen and brown ink with traces of red chalk, heightened with white on pink prepared paper | \n",
" 75840 | \n",
" https://api.nga.gov/iiif/6e53c5bd-799d-4ac8-a57d-2c831a57da14/full/!200,200/0/default.jpg | \n",
"
\n",
" \n",
" 2 | \n",
" Lamp, Lower Portion | \n",
" Anonymous Artist after Andrea Briosco, called Riccio | \n",
" gilded bronze | \n",
" 130749 | \n",
" https://api.nga.gov/iiif/8e5477ed-040f-4240-89ca-08d95b1c955b/full/!200,200/0/default.jpg | \n",
"
\n",
" \n",
" 3 | \n",
" Andiron with Putto Finial | \n",
" Nicolò Roccatagliata | \n",
" bronze | \n",
" 73441 | \n",
" https://api.nga.gov/iiif/a6126402-696e-4333-96af-43362bef1afa/full/!200,200/0/default.jpg | \n",
"
\n",
" \n",
" 4 | \n",
" Dispatch No. 4: THREE VALLEYS. The Valleys of Silicon, San Joaquin, and Death | \n",
" Alec Soth | \n",
" inkjet print and 48 page newsprint booklet in portfolio case | \n",
" 221224 | \n",
" https://api.nga.gov/iiif/29e05dbf-f0e3-4088-9ffe-83d4ca8c1968/full/!200,200/0/default.jpg | \n",
"
\n",
" \n",
"
"
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"import meerkat as mk\n",
"\n",
"df = mk.from_csv(\"_data/art_ngoa.csv\")\n",
"df.head()"
]
},
{
"cell_type": "markdown",
"id": "7b0f0f09",
"metadata": {},
"source": [
" Notice that each row corresponds to a single work of art, and each column corresponds to a different attribute of the work of art. \n",
"\n",
" **Representing images.** The last column, `iiifthumburl`, contains a URL to a thumbnail image of the work.\n",
"Using {func}`~meerkat.image`, we can download the thumbnail image and display it in the DataFrame."
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "aa7e4759",
"metadata": {
"tags": [
"output_scroll"
]
},
"outputs": [
{
"data": {
"text/html": [
"\n",
" \n",
" \n",
" | \n",
" image | \n",
" title | \n",
" attribution | \n",
"
\n",
" \n",
" \n",
" \n",
" 0 | \n",
"  | \n",
" Boy with Cat | \n",
" Ernst Ludwig Kirchner | \n",
"
\n",
" \n",
" 1 | \n",
"  | \n",
" A Hound Chasing a Hare | \n",
" Benozzo Gozzoli | \n",
"
\n",
" \n",
" 2 | \n",
"  | \n",
" Lamp, Lower Portion | \n",
" Anonymous Artist after Andrea Briosco, called Riccio | \n",
"
\n",
" \n",
" 3 | \n",
"  | \n",
" Andiron with Putto Finial | \n",
" Nicolò Roccatagliata | \n",
"
\n",
" \n",
" 4 | \n",
"  | \n",
" Dispatch No. 4: THREE VALLEYS. The Valleys of Silicon, San Joaquin, and Death | \n",
" Alec Soth | \n",
"
\n",
" \n",
"
"
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"df[\"image\"] = mk.image(df[\"iiifthumburl\"], downloader=\"url\")\n",
"df[[\"image\", \"title\", \"attribution\"]].head()"
]
},
{
"cell_type": "markdown",
"id": "dea2a1a1",
"metadata": {},
"source": [
"The function `mk.image` creates a {class}`~meerkat.ImageColumn` which defers the downloading of images from the URLs until the data is needed. \n",
"\n",
"```{admonition} Deferred Columns\n",
"If you're wondering how {class}`~meerkat.ImageColumn` works, check out the guide on {doc}`column/deferred`. \n",
"```\n",
"\n",
"**Adding a primary key.** The `objectid` column contains a unique identifier for each work of art. We can use {func}`~meerkat.set_primary_key` to set this column as the primary key for the DataFrame, which allows us to perform key-based indexing on the DataFrame."
]
},
{
"cell_type": "code",
"execution_count": 3,
"id": "f928ef1c",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"{'title': 'Dispatch No. 4: THREE VALLEYS. The Valleys of Silicon, San Joaquin, and Death',\n",
" 'attribution': 'Alec Soth',\n",
" 'medium': 'inkjet print and 48 page newsprint booklet in portfolio case',\n",
" 'objectid': 221224,\n",
" 'iiifthumburl': 'https://api.nga.gov/iiif/29e05dbf-f0e3-4088-9ffe-83d4ca8c1968/full/!200,200/0/default.jpg',\n",
" 'image': FileCell(fn=)}"
]
},
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"df = df.set_primary_key(\"objectid\")\n",
"df.loc[221224]"
]
},
{
"cell_type": "markdown",
"id": "e99b3bfd",
"metadata": {},
"source": [
"The {func}`~meerkat.from_csv` function has a utility parameter `primary_key` which can be used to set the primary key when the DataFrame is created."
]
},
{
"cell_type": "code",
"execution_count": 4,
"id": "f7b28dbb",
"metadata": {
"tags": [
"output_scroll"
]
},
"outputs": [
{
"data": {
"text/html": [
"\n",
" \n",
" \n",
" | \n",
" title | \n",
" attribution | \n",
" medium | \n",
" objectid | \n",
" iiifthumburl | \n",
"
\n",
" \n",
" \n",
" \n",
" 0 | \n",
" Boy with Cat | \n",
" Ernst Ludwig Kirchner | \n",
" lithograph on yellow wove paper | \n",
" 103631 | \n",
" https://api.nga.gov/iiif/b309afc0-b270-4c29-9ce7-e8f39125f40d/full/!200,200/0/default.jpg | \n",
"
\n",
" \n",
" 1 | \n",
" A Hound Chasing a Hare | \n",
" Benozzo Gozzoli | \n",
" pen and brown ink with traces of red chalk, heightened with white on pink prepared paper | \n",
" 75840 | \n",
" https://api.nga.gov/iiif/6e53c5bd-799d-4ac8-a57d-2c831a57da14/full/!200,200/0/default.jpg | \n",
"
\n",
" \n",
" 2 | \n",
" Lamp, Lower Portion | \n",
" Anonymous Artist after Andrea Briosco, called Riccio | \n",
" gilded bronze | \n",
" 130749 | \n",
" https://api.nga.gov/iiif/8e5477ed-040f-4240-89ca-08d95b1c955b/full/!200,200/0/default.jpg | \n",
"
\n",
" \n",
" 3 | \n",
" Andiron with Putto Finial | \n",
" Nicolò Roccatagliata | \n",
" bronze | \n",
" 73441 | \n",
" https://api.nga.gov/iiif/a6126402-696e-4333-96af-43362bef1afa/full/!200,200/0/default.jpg | \n",
"
\n",
" \n",
" 4 | \n",
" Dispatch No. 4: THREE VALLEYS. The Valleys of Silicon, San Joaquin, and Death | \n",
" Alec Soth | \n",
" inkjet print and 48 page newsprint booklet in portfolio case | \n",
" 221224 | \n",
" https://api.nga.gov/iiif/29e05dbf-f0e3-4088-9ffe-83d4ca8c1968/full/!200,200/0/default.jpg | \n",
"
\n",
" \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
"
\n",
" \n",
" 94 | \n",
" Mountain Landscape with a Hollow | \n",
" Alexander Cozens | \n",
" brush drawing in brown wash on laid paper | \n",
" 65569 | \n",
" https://api.nga.gov/iiif/d26d1ba9-7814-4a7e-9d8b-1c0d24f76d7b/full/!200,200/0/default.jpg | \n",
"
\n",
" \n",
" 95 | \n",
" On the Vimy to Lens Road | \n",
" David Young Cameron | \n",
" watercolor and graphite | \n",
" 5708 | \n",
" https://api.nga.gov/iiif/5e06918b-e6cb-4639-8452-2e050db3d2e9/full/!200,200/0/default.jpg | \n",
"
\n",
" \n",
" 96 | \n",
" Girl Writer | \n",
" Ralph Austin | \n",
" lithograph | \n",
" 148623 | \n",
" https://api.nga.gov/iiif/57e15461-94b3-4020-8a8a-46884c2cc50d/full/!200,200/0/default.jpg | \n",
"
\n",
" \n",
" 97 | \n",
" Jean de Saulx, 1555-1629, Viscount of Tavanes and Lugny, and Marquess of Mirabet [obverse] | \n",
" French 17th Century | \n",
" bronze | \n",
" 45344 | \n",
" https://api.nga.gov/iiif/ccd2d7b2-6119-4326-aa04-cb61e28f11a3/full/!200,200/0/default.jpg | \n",
"
\n",
" \n",
" 98 | \n",
" From My Window at the Shelton, North | \n",
" Alfred Stieglitz | \n",
" gelatin silver print | \n",
" 36364 | \n",
" https://api.nga.gov/iiif/cc3afc42-5e1a-4228-8c45-7f17f27c224c/full/!200,200/0/default.jpg | \n",
"
\n",
" \n",
"
"
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"mk.from_csv(\"_data/art_ngoa.csv\", primary_key=\"objectid\")"
]
},
{
"cell_type": "markdown",
"id": "6bfcd694",
"metadata": {},
"source": [
"```{admonition} Primary Keys\n",
"To learn more about primary keys and key-based indexing, check out the section {ref}`key-based-selection`. \n",
"```\n",
"\n",
"### Importing from storage formats\n",
"Meerkat supports importing data from a number of other file formats. As in the example above, you may need to set the primary key and/or add additional columns for complex data (*e.g.* images, audio).\n",
"\n",
"- {func}`~meerkat.from_csv()`: Reads in data from a CSV (comma-separated values) file. CSV files are a common format for storing tabular data.\n",
"\n",
"- {func}`~meerkat.from_feather()`: Reads in data from a [Feather file](https://arrow.apache.org/docs/python/feather.html). Feather is a language-agnostic file format for storing DataFrames. It can provide significantly faster I/O than CSV. \n",
"\n",
"- {func}`~meerkat.from_parquet()`: Reads in data from a [Parquet file](https://parquet.apache.org/). Parquet is a columnar storage format that is designed for efficiency. \n",
"\n",
"- {func}`~meerkat.from_json()`: Reads in data from a JSON file. \n",
"\n",
"If your data is in a format not listed here, load it into a Pandas DataFrame and use {func}`~meerkat.from_pandas()` to convert it to a Meerkat DataFrame.\n",
"\n",
"### Importing from other libraries \n",
"It's also posible to import data from third-party Python libraries like [Pandas](https://pandas.pydata.org/) and [HuggingFace Datasets](https://huggingface.co/datasets).\n",
"\n",
"- {func}`~meerkat.from_pandas()`: Converts a [Pandas DataFrame](https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.html) to a Meerkat DataFrame. By default, the index of the Pandas DataFrame will be used as the primary key for the Meerkat DataFrame.\n",
"\n",
"- {func}`~meerkat.from_arrow()`: Converts an [Arrow Table](https://arrow.apache.org/docs/python/generated/pyarrow.Table.html#pyarrow.Table) to a Meerkat DataFrame.\n",
"\n",
"\n",
"- {func}`~meerkat.from_huggingface()`: Converts a HuggingFace Dataset to a Meerkat DataFrame. By default, the index of the HuggingFace Dataset will be used as the primary key for the Meerkat DataFrame.\n",
"\n",
"\n",
"(exporting)=\n",
"## Exporting DataFrames\n",
"Meerkat supports exporting DataFrames from Meerkat to other file formats and libraries. These methods are useful for converting data into formats that can be used by other libraries or software.\n",
"\n",
"```{warning}\n",
"\n",
"Most file formats designed for tabular data do not offer the same flexibility as Meerkat DataFrames, especially when it comes to storing complex data types and multi-dimensional tensors. As a result, exporting a Meerkat DataFrame to a file format may result in data loss.\n",
"\n",
"Specifically, any {class}`~meerkat.DeferredColumn` (or its subclasses) will not be exported. If you want to export a {class}`DeferredColumn`, you should first materialize the column(s) by calling the DataFrame. Also, depending on the export destination, any {class}`~meerkat.TensorColumn` and/or {class}`~meerkat.ObjectColumn` in the DataFrame may not be exported.\n",
"```\n",
"\n",
"If you simply want to save a Meerkat DataFrame to disk, you should use {func}`~meerkat.DataFrame.write()` instead (see {ref}`writing-dataframes`). This will persist the DataFrame in a format that can be read back into Meerkat without any data loss.\n",
"\n",
"Continuing with the example above, let's export the DataFrame to a CSV file."
]
},
{
"cell_type": "code",
"execution_count": 5,
"id": "b322b1bc",
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/runner/work/meerkat/meerkat/meerkat/dataframe.py:901: UserWarning: Could not convert column image of type , it will be dropped from the output.\n",
" warnings.warn(\n"
]
}
],
"source": [
"df.to_csv(\"_data/art_ngoa_export.csv\")"
]
},
{
"cell_type": "markdown",
"id": "63e02881",
"metadata": {},
"source": [
"If we inspect the first 5 lines of the CSV file from the command line, we can see that the `image` column is missing. This is because the `image` column is a {class}`~meerkat.DeferredColumn` and was not exported."
]
},
{
"cell_type": "code",
"execution_count": 6,
"id": "f6775dc8",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"title,attribution,medium,objectid,iiifthumburl\r\n",
"Boy with Cat,Ernst Ludwig Kirchner,lithograph on yellow wove paper,103631,\"https://api.nga.gov/iiif/b309afc0-b270-4c29-9ce7-e8f39125f40d/full/!200,200/0/default.jpg\"\r\n",
"A Hound Chasing a Hare,Benozzo Gozzoli,\"pen and brown ink with traces of red chalk, heightened with white on pink prepared paper\",75840,\"https://api.nga.gov/iiif/6e53c5bd-799d-4ac8-a57d-2c831a57da14/full/!200,200/0/default.jpg\"\r\n",
"\"Lamp, Lower Portion\",\"Anonymous Artist after Andrea Briosco, called Riccio\",gilded bronze,130749,\"https://api.nga.gov/iiif/8e5477ed-040f-4240-89ca-08d95b1c955b/full/!200,200/0/default.jpg\"\r\n",
"Andiron with Putto Finial,Nicolò Roccatagliata,bronze,73441,\"https://api.nga.gov/iiif/a6126402-696e-4333-96af-43362bef1afa/full/!200,200/0/default.jpg\"\r\n"
]
}
],
"source": [
"!head -n 5 _data/art_ngoa_export.csv"
]
},
{
"cell_type": "markdown",
"id": "29eace92",
"metadata": {},
"source": [
"When columns are dropped during export, a warning is raised.\n",
"\n",
"### Exporting to storage formats\n",
"\n",
"Meerkat supports exporting DataFrames to a number of file formats, with the {class}`~meerkat.DataFrame` class providing the methods listed below. \n",
"\n",
"- {func}`~meerkat.DataFrame.to_csv()`: Writes the DataFrame to a CSV file. CSV files are a common format for storing tabular data. Unlike some alternatives, CSV files are human-readable in a text-editor and can be easily imported into spreadsheet software.\n",
"- {func}`~meerkat.DataFrame.to_feather()`: Writes the DataFrame to a [Feather file](https://arrow.apache.org/docs/python/feather.html). Feather is a language-agnostic file format for storing DataFrames. It can provide significantly faster I/O than CSV.\n",
"- {func}`~meerkat.DataFrame.to_parquet()`: Writes the DataFrame to a [Parquet file](https://parquet.apache.org/). Parquet is a columnar storage format that is designed for efficiency.\n",
"- {func}`~meerkat.DataFrame.to_json()`: Writes the DataFrame to a JSON file.\n",
"\n",
"Note that several of the methods take an optional `engine` parameter. This parameter allows you to control the underlying library that is used to write the DataFrame to disk. Options include: `pandas` and `arrow`. If no `engine` is specified, one is automatically chosen based on the columns in the DataFrame. For example, we can write the DataFrame to a CSV file using the Arrow library instead of Pandas."
]
},
{
"cell_type": "code",
"execution_count": 7,
"id": "0ddda026",
"metadata": {},
"outputs": [],
"source": [
"df.to_csv(\"_data/art_ngoa_export_arrow.csv\", engine=\"arrow\")"
]
},
{
"cell_type": "markdown",
"id": "9cff1163",
"metadata": {},
"source": [
"### Exporting to other libraries\n",
"\n",
"It is also possible to export Meerkat DataFrames to other Python DataFrame libraries. \n",
"\n",
"- {func}`~meerkat.DataFrame.to_pandas()`: Converts the DataFrame to a [Pandas DataFrame](https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.html)\n",
"- {func}`~meerkat.DataFrame.to_arrow()`: Converts the DataFrame to an [Arrow Table](https://arrow.apache.org/docs/python/generated/pyarrow.Table.html#pyarrow.Table).\n",
"\n",
"(persisting)=\n",
"## Persisting DataFrames\n",
"In this section, we discuss how to persist Meerkat DataFrames to disk using the {func}`~meerkat.DataFrame.write()` method. Unlike the export methods discussed above, {func}`~meerkat.DataFrame.write()` guarantees that the DataFrame read back in with {func}`~meerkat.read` will contain the exact sam columns as the original DataFrame.\n",
"(writing-dataframes)=\n",
"### Writing DataFrames \n",
"Above we saw how some column types in Meerkat DataFrames cannot be exported to a single file format. Specifically, we saw that the column we created to display images was dropped when exporting to CSV.\n",
"\n",
"{func}`~meerkat.DataFrame.write` allows us to persist the DataFrame to disk in a way that will preserve the image column."
]
},
{
"cell_type": "code",
"execution_count": 8,
"id": "071d5e51",
"metadata": {},
"outputs": [],
"source": [
"df.write(\"_data/art_ngoa.mk\")"
]
},
{
"cell_type": "markdown",
"id": "36d42136",
"metadata": {},
"source": [
"*How does it work?* Under the hood, {func}`~meerkat.DataFrame.write` works by splitting the DataFrame among several different files. For example, the {class}`~meerkat.ScalarColumn`s could be stored together in a [Feather file](https://arrow.apache.org/docs/python/feather.html), while the {class}`~meerkat.TensorColumn`s could be stored in [NPY format](https://numpy.org/doc/stable/reference/generated/numpy.lib.format.html#module-numpy.lib.format). The path passed to {func}`~meerkat.DataFrame.write` is the directory where the files will be stored. The directory will also contain a `meta.yaml` file that contains information about the DataFrame. This file is used by {func}`~meerkat.read()` to reconstruct the DataFrame.\n",
"\n",
"### Reading DataFrames \n",
"To read the DataFrame back in from disk, we can use the {func}`~meerkat.read()` function."
]
},
{
"cell_type": "code",
"execution_count": 9,
"id": "b3082201",
"metadata": {
"tags": [
"output_scroll"
]
},
"outputs": [
{
"data": {
"text/html": [
"\n",
" \n",
" \n",
" | \n",
" title | \n",
" attribution | \n",
" medium | \n",
" objectid | \n",
" iiifthumburl | \n",
" image | \n",
"
\n",
" \n",
" \n",
" \n",
" 0 | \n",
" Boy with Cat | \n",
" Ernst Ludwig Kirchner | \n",
" lithograph on yellow wove paper | \n",
" 103631 | \n",
" https://api.nga.gov/iiif/b309afc0-b270-4c29-9ce7-e8f39125f40d/full/!200,200/0/default.jpg | \n",
"  | \n",
"
\n",
" \n",
" 1 | \n",
" A Hound Chasing a Hare | \n",
" Benozzo Gozzoli | \n",
" pen and brown ink with traces of red chalk, heightened with white on pink prepared paper | \n",
" 75840 | \n",
" https://api.nga.gov/iiif/6e53c5bd-799d-4ac8-a57d-2c831a57da14/full/!200,200/0/default.jpg | \n",
"  | \n",
"
\n",
" \n",
" 2 | \n",
" Lamp, Lower Portion | \n",
" Anonymous Artist after Andrea Briosco, called Riccio | \n",
" gilded bronze | \n",
" 130749 | \n",
" https://api.nga.gov/iiif/8e5477ed-040f-4240-89ca-08d95b1c955b/full/!200,200/0/default.jpg | \n",
"  | \n",
"
\n",
" \n",
" 3 | \n",
" Andiron with Putto Finial | \n",
" Nicolò Roccatagliata | \n",
" bronze | \n",
" 73441 | \n",
" https://api.nga.gov/iiif/a6126402-696e-4333-96af-43362bef1afa/full/!200,200/0/default.jpg | \n",
"  | \n",
"
\n",
" \n",
" 4 | \n",
" Dispatch No. 4: THREE VALLEYS. The Valleys of Silicon, San Joaquin, and Death | \n",
" Alec Soth | \n",
" inkjet print and 48 page newsprint booklet in portfolio case | \n",
" 221224 | \n",
" https://api.nga.gov/iiif/29e05dbf-f0e3-4088-9ffe-83d4ca8c1968/full/!200,200/0/default.jpg | \n",
"  | \n",
"
\n",
" \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
"
\n",
" \n",
" 94 | \n",
" Mountain Landscape with a Hollow | \n",
" Alexander Cozens | \n",
" brush drawing in brown wash on laid paper | \n",
" 65569 | \n",
" https://api.nga.gov/iiif/d26d1ba9-7814-4a7e-9d8b-1c0d24f76d7b/full/!200,200/0/default.jpg | \n",
"  | \n",
"
\n",
" \n",
" 95 | \n",
" On the Vimy to Lens Road | \n",
" David Young Cameron | \n",
" watercolor and graphite | \n",
" 5708 | \n",
" https://api.nga.gov/iiif/5e06918b-e6cb-4639-8452-2e050db3d2e9/full/!200,200/0/default.jpg | \n",
"  | \n",
"
\n",
" \n",
" 96 | \n",
" Girl Writer | \n",
" Ralph Austin | \n",
" lithograph | \n",
" 148623 | \n",
" https://api.nga.gov/iiif/57e15461-94b3-4020-8a8a-46884c2cc50d/full/!200,200/0/default.jpg | \n",
"  | \n",
"
\n",
" \n",
" 97 | \n",
" Jean de Saulx, 1555-1629, Viscount of Tavanes and Lugny, and Marquess of Mirabet [obverse] | \n",
" French 17th Century | \n",
" bronze | \n",
" 45344 | \n",
" https://api.nga.gov/iiif/ccd2d7b2-6119-4326-aa04-cb61e28f11a3/full/!200,200/0/default.jpg | \n",
"  | \n",
"
\n",
" \n",
" 98 | \n",
" From My Window at the Shelton, North | \n",
" Alfred Stieglitz | \n",
" gelatin silver print | \n",
" 36364 | \n",
" https://api.nga.gov/iiif/cc3afc42-5e1a-4228-8c45-7f17f27c224c/full/!200,200/0/default.jpg | \n",
"  | \n",
"
\n",
" \n",
"
"
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"mk.read(\"_data/art_ngoa.mk\")"
]
},
{
"cell_type": "markdown",
"id": "3e6552a9",
"metadata": {},
"source": [
"Note that all the columns are present, including the `image` column, which had previously been lost with {func}`~meerkat.DataFrame.to_csv`."
]
}
],
"metadata": {
"file_format": "mystnb",
"kernelspec": {
"display_name": "python3",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.17"
},
"source_map": [
5,
38,
45,
53,
58,
67,
70,
72,
76,
120,
122,
125,
127,
140,
142,
160,
162,
169,
173
]
},
"nbformat": 4,
"nbformat_minor": 5
}