Checking The Met dresses

Import Met CSV database into a dataframe

This is more than 400,000 rows, so it may take 10-20 seconds or more

%%time
import csv
from urllib.request import urlopen
import codecs
# from tqdm import tqdm
# from tqdm._tqdm_notebook import tqdm_notebook
import requests
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from dateutil.parser import parse

# The Met's weekly CSV dump URL in Github is quite big at 250 Mbytes
# Comment out for now, since this is slow to load. 
# url = 'https://media.githubusercontent.com/media/metmuseum/openaccess/master/MetObjects.csv'

# Use local copy of CSV file for speed and read the CSV file into a pandas dataframe
url = 'metmuseum/MetObjects-20190425.csv'
met_df = pd.read_csv(url,low_memory=False)
CPU times: user 19 s, sys: 1.48 s, total: 20.5 s
Wall time: 20.6 s

Examine the structure of rows

Take a look at some of the rows. NaN means "not a number" or a blank from the CSV file.

met_df.sample(1)
Object Number Is Highlight Is Public Domain Object ID Department Object Name Title Culture Period Dynasty ... Locale Locus Excavation River Classification Rights and Reproduction Link Resource Metadata Date Repository Tags
422990 2011.604.1.3787 False True 693377 Greek and Roman Art Kylix fragment Terracotta fragment of a kylix (drinking cup) Greek, Attic Classical NaN ... NaN NaN NaN NaN Vases NaN http://www.metmuseum.org/art/collection/search... 4/22/2019 8:00:03 AM Metropolitan Museum of Art, New York, NY NaN

1 rows × 44 columns

Statistics on most used and unique terms

The most frequently used terms can be found in the row labeled "top." In summary:

  1. Drawings and prints departement has the most items
  2. Object number "62.635" is used four times, which we can investigate below.
met_df.describe(include=[np.object])
Object Number Department Object Name Title Culture Period Dynasty Reign Portfolio Artist Role ... Locale Locus Excavation River Classification Rights and Reproduction Link Resource Metadata Date Repository Tags
count 494311 494311 489851 463050 209050 89550 23284 11205 22217 285440 ... 15562 7329 15967 2098 437900 24940 494311 494311 494311 277566
unique 491608 19 28302 251441 7267 1811 381 380 3274 6326 ... 859 1352 364 230 1227 1427 494311 1 1 55172
top 62.635 Drawings and Prints Print Fragment American Edo period (1615–1868) Dynasty 18 reign of Amenhotep III Les Images De Tous Les Saincts et Saintes de L... Artist ... Cemetery debris MMA excavations Upper Sepik River Prints © Walker Evans Archive, The Metropolitan Museu... http://www.metmuseum.org/art/collection/search... 4/22/2019 8:00:03 AM Metropolitan Museum of Art, New York, NY Men|Portraits|Baseball|Athletes
freq 4 178182 101945 7011 28404 8879 7178 2730 601 115028 ... 1925 416 2387 361 76967 9204 1 494311 494311 9706

4 rows × 39 columns

met_df.info()
<class 'pandas.core.frame.DataFrame'>
RangeIndex: 494311 entries, 0 to 494310
Data columns (total 44 columns):
Object Number              494311 non-null object
Is Highlight               494311 non-null bool
Is Public Domain           494311 non-null bool
Object ID                  494311 non-null int64
Department                 494311 non-null object
Object Name                489851 non-null object
Title                      463050 non-null object
Culture                    209050 non-null object
Period                     89550 non-null object
Dynasty                    23284 non-null object
Reign                      11205 non-null object
Portfolio                  22217 non-null object
Artist Role                285440 non-null object
Artist Prefix              98323 non-null object
Artist Display Name        287530 non-null object
Artist Display Bio         237989 non-null object
Artist Suffix              12208 non-null object
Artist Alpha Sort          287495 non-null object
Artist Nationality         193440 non-null object
Artist Begin Date          240617 non-null object
Artist End Date            237808 non-null object
Object Date                479252 non-null object
Object Begin Date          494311 non-null int64
Object End Date            494311 non-null int64
Medium                     486728 non-null object
Dimensions                 417876 non-null object
Credit Line                493520 non-null object
Geography Type             60369 non-null object
City                       32248 non-null object
State                      2805 non-null object
County                     8576 non-null object
Country                    76812 non-null object
Region                     31975 non-null object
Subregion                  22277 non-null object
Locale                     15562 non-null object
Locus                      7329 non-null object
Excavation                 15967 non-null object
River                      2098 non-null object
Classification             437900 non-null object
Rights and Reproduction    24940 non-null object
Link Resource              494311 non-null object
Metadata Date              494311 non-null object
Repository                 494311 non-null object
Tags                       277566 non-null object
dtypes: bool(2), int64(3), object(39)
memory usage: 159.3+ MB

Analyzing dresses and robes only Public Domain

fashion_df = met_df[(met_df['Object Name'].str.match('^[Dd]ress$',na=False) | met_df['Object Name'].str.match('^Robe$',na=False))& met_df['Is Public Domain']][
    ['Object ID','Title','Department','Object Name','Medium','Classification','Is Public Domain','Is Highlight']
]
fashion_df
Object ID Title Department Object Name Medium Classification Is Public Domain Is Highlight
39241 45189 NaN Asian Art Robe Silk satin with supplementary weft patterning ... Costumes True False
39250 45200 紫綸子地龍田川模様打掛|Outer Robe (Uchikake) with Maple T... Asian Art Robe Resist-dyed silk satin damask embroidered with... Costumes True False
39436 45387 白綸子地滝松桜尾長鳥模様打掛|Over Robe (Uchikake) with Long-... Asian Art Robe Silk and metallic-thread embroidery and stenci... Costumes True False
44316 51083 NaN Asian Art Robe Resist-dyed and painted (bingata) silk crepe Costumes True False
46498 53713 清中期 納紗繡戯服男帔|Theatrical Robe for a Male Role Asian Art Robe Silk florentine stitch embroidery on silk gauze Costumes-Embroidered True False
46500 53715 清早期 刺繡百蝠紋女吉服袍|Woman's Ceremonial Robe (The Bat... Asian Art Robe Silk and metallic thread embroidery on silk satin Costumes-Embroidered True False
46627 53902 NaN Asian Art Robe appliquéd and embroidered elm fiber Costumes True False
46642 53919 NaN Asian Art Robe Cotton Costumes True False
52555 60506 清乾隆 刺繡御用十二章吉服袍|Emperor’s twelve-symbol festiva... Asian Art Robe Silk and gold and silver thread embroidery on ... Costumes-Embroidered True False
53822 61851 NaN Asian Art Robe Resist-dyed and painted (bingata) silk crepe Costumes True False
56242 64509 NaN Asian Art Robe Silk and metallic thread tapestry (kesi) Costumes-Tapestries True False
56303 65008 白縮緬地橘文字模様小袖|Robe (Kosode) with Mandarin Orange... Asian Art Robe Dyed and embroidered silk crepe with couched g... Costumes True False
56588 65368 NaN Asian Art Robe Silk and metal tapestry on gold ground. Textiles-Costumes True False
56624 65607 黒綸子地橘蝶熨斗模様打掛|Outer Robe (Uchikake) with Mandar... Asian Art Robe Tie-dyed satin damask with silk embroidery and... Textiles-Costumes True False
56643 65641 清康熙 白妝花緞云龍紋箭衣|Theatrical Robe for a Military Role Asian Art Robe Silk brocade with metallic thread Costumes-Woven True False
56644 65642 NaN Asian Art Robe Silk Costumes-Woven True False
56683 65682 NaN Asian Art Robe Satin Textiles-Costumes True False
56736 65757 NaN Asian Art Robe Silk Costumes True False
59265 68295 NaN Asian Art Robe Silk and metallic thread embroidery on silk satin Costumes-Embroidered True False
59476 68506 NaN Asian Art Robe Silk and metallic thread Costumes-Tapestries True False
59531 68561 NaN Asian Art Robe Silk, metallic thread, and peacock feather fil... Costumes-Embroidered True False
60032 69062 NaN Asian Art Robe Silk satin embroidered with silk and metallic ... Costumes-Embroidered True False
60033 69063 NaN Asian Art Robe Silk and metallic thread embroidery on silk sa... Costumes-Woven True False
60036 69066 NaN Asian Art Robe Silk and metallic thread embroidery on silk satin Costumes-Embroidered True False
60510 69540 NaN Asian Art Robe Silk and metallic thread embroidery on silk gauze Costumes-Embroidered True False
60812 69900 NaN Asian Art Robe Tapestry-woven (kesi) silk Costumes-Tapestries True False
61271 70360 NaN Asian Art Robe Silk, wrapped gold on cream silk, wrapped peac... Textiles-Costumes True False
61556 70652 NaN Asian Art Robe Elm-bark fiber with appliqué of indigo-dyed ta... Textiles-Costumes True False
61629 70725 NaN Asian Art Robe Silk Textiles-Costumes True False
61641 70737 NaN Asian Art Robe Silk, wrapped gold Textiles-Costumes True False
... ... ... ... ... ... ... ... ...
98281 175605 Dress Costume Institute Dress Wool NaN True False
98298 175622 Dress Costume Institute Dress Silk NaN True False
98318 175663 Dress Costume Institute Dress Cotton, silk NaN True False
98617 185391 Dress Costume Institute Dress cotton NaN True False
137303 229102 Dress for a statuette European Sculpture and Decorative Arts Dress Polychromed lead, glass; silver; silk and silv... Textiles-Woven True False
198460 317736 Woman's Dress Arts of Africa, Oceania, and the Americas Dress Camelid hair Textiles-Woven True True
199034 318347 Woman's Dress Arts of Africa, Oceania, and the Americas Dress Native-tanned leather, glass beads Hide-Costumes True False
199040 318353 Ceremonial Robe Arts of Africa, Oceania, and the Americas Robe Native-tanned leather, pigment Hide-Costumes True False
313791 448247 Man's Robe (Jama) with Poppies Islamic Art Robe Cotton; painted, with applied gold leaf Textiles-Costumes True False
316694 451160 Robe Islamic Art Robe Wool, silk and gilt thread Textiles-Costumes True False
319166 453840 Robe Islamic Art Robe Silk; embroidered in silk thread; cotton lining Textiles-Costumes True False
322449 460296 Christ Child's dress Robert Lehman Collection Dress silk; linen; metal; cardboard; cotton Textiles-Embroidered True False
322736 460589 Madonna dress Robert Lehman Collection Dress cotton; metal; silk; Textiles-Ecclesiastical True False
322916 460774 Kesa (Buddhist priest's robe) Robert Lehman Collection Robe Silk, gold leaf on lacquered paper strip, and ... Textiles-Ecclesiastical True False
331449 475080 Dress Medieval Art Dress Linen, wool Textiles-Costumes-Secular True False
331467 475098 Dress Medieval Art Dress Linen Textiles-Costumes-Secular True False
331471 475102 Dress Medieval Art Dress Linen, wool Textiles-Costumes-Secular True False
331472 475103 Dress Medieval Art Dress Linen, wool Textiles-Costumes-Secular True False
331474 475105 Dress Medieval Art Dress Linen, wool Textiles-Costumes-Secular True False
331475 475106 Dress Medieval Art Dress Linen, wool Textiles-Costumes-Secular True False
331476 475107 Child's Tunic Medieval Art Dress Linen, wool: Tapestry weave in purple-colored ... Textiles-Costumes-Secular True False
331477 475108 Dress Medieval Art Dress Linen, wool Textiles-Costumes-Secular True False
331479 475110 Dress Medieval Art Dress Linen, wool Textiles-Costumes-Secular True False
331485 475116 Tunic Medieval Art Dress Plain weave in undyed linen; self-bands Textiles-Costumes-Secular True False
385336 634517 Dress Costume Institute Dress cotton, linen NaN True False
411803 676068 Dress Costume Institute Dress cotton NaN True False
421265 690275 Dress Costume Institute Dress cotton, silver NaN True False
433578 708524 Dress Costume Institute Dress silk NaN True False
458050 745958 Dress Costume Institute Dress silk, linen, mother-of-pearl, metal NaN True False
484337 785512 御所解源氏物語模様帷子|Summer Robe (Katabira) with Season... Asian Art Robe Plain-weave ramie with paste resist-dyeing, si... Textiles-Costumes True False

768 rows × 8 columns

ax = fashion_df['Department'].value_counts()[:15].plot(kind='barh')

ax.spines['right'].set_visible(False)
ax.spines['top'].set_visible(False)
ax.spines['left'].set_visible(False)
ax.spines['bottom'].set_visible(False)

# Switch off ticks
ax.tick_params(axis="both", which="both", bottom=False, top=False, labelbottom=True, left=False, right=False, labelleft=True)

# Draw vertical axis lines
vals = ax.get_xticks()
for tick in vals:
    ax.axvline(x=tick, linestyle='dashed', alpha=0.4, color='#eeeeee', zorder=1)

# Set x-axis label
ax.set_xlabel("Count", labelpad=20, weight='bold', size=12)

# Set y-axis label
ax.set_ylabel("Department", labelpad=20, weight='bold', size=12)

# Format y-axis label
# ax.xaxis.set_major_formatter(StrMethodFormatter('{x:,g}'))
    
ax.invert_yaxis()
ax = fashion_df['Is Highlight'].value_counts()[:15].plot(kind='barh')

ax.spines['right'].set_visible(False)
ax.spines['top'].set_visible(False)
ax.spines['left'].set_visible(False)
ax.spines['bottom'].set_visible(False)

# Switch off ticks
ax.tick_params(axis="both", which="both", bottom=False, top=False, labelbottom=True, left=False, right=False, labelleft=True)

# Draw vertical axis lines
vals = ax.get_xticks()
for tick in vals:
    ax.axvline(x=tick, linestyle='dashed', alpha=0.4, color='#eeeeee', zorder=1)

# Set x-axis label
ax.set_xlabel("Count", labelpad=20, weight='bold', size=12)

# Set y-axis label
ax.set_ylabel("Artist", labelpad=20, weight='bold', size=12)

# Format y-axis label
# ax.xaxis.set_major_formatter(StrMethodFormatter('{x:,g}'))
    
ax.invert_yaxis()
fashion_df[fashion_df['Is Highlight']]['Object ID']
67059      79220
68736      81130
75306      95534
75632      96434
80376     107620
198460    317736
Name: Object ID, dtype: int64