Skip to content
Advertisement

Where does the id field, eg “wound-transition” in a jupyter notebook come from and what does it mean?

If you look at the raw JSON of a jupyter notebook (python in this case), each cell has a field labeled “id”, and they seem to be made up of hyphenated random word pairs, and are often rather funny. A couple random examples:

 "id": "rough-girlfriend",
 "id": "wound-transition"
 "id": "orange-biography"
 "id": "mediterranean-viking",

I’ve done some googling but I can’t seem to find any information on these fields! What do they mean? Where do they come from? How are they generated?

Any info much appreciated.

Advertisement

Answer

Essentially, it seems they are meant to provide human-readable cell identifiers. There is a longer explanation of the need for such fields in the enhancement proposal. The document also points to the exact implementation in nbformat.

They are quite funny, as they are made of a random noun and a random adjective. I personally find them rather annoying though, as they tend to change unexpectedly, making git diffs ugly.

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement