Search code examples
pythonjupyter-notebook

Notebook validation failed: Additional properties are not allowed ('id' was unexpected):


Getting below validation error on opening my notebook:

{
 "metadata": {
  "trusted": true
 },
 "id": "comparative-import",
 "cell_type": "code",
 "source": "import numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt\nimport seaborn as sns\nimport nltk\nimport re\nimport gensim \nfrom gensim.utils import simple_preprocess\nfrom gensim.models.word2vec import Word2Vec\nfrom nltk.stem.porter import PorterStemmer\nfrom nltk.corpus import stopwords\nfrom sklearn.decomposition import PCA,TruncatedSVD\nfrom sklearn.manifold import TSNE\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.linear_model import LogisticRegression\nfrom wordcloud import WordCloud, STOPWORDS, ImageColorGenerator\n",
 "execution_count": 10,
 "outputs": []
}

Solution

  • I worked around the above issue by copying the contents of the cell instead of the entire cell (which copies also metadata).

    Caution: this does not scale well for large notebooks (every cell has to be handled individually).