Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

weird commas appered in the notebook editor #2939

Closed
stevenlis opened this issue Oct 9, 2019 · 9 comments
Closed

weird commas appered in the notebook editor #2939

stevenlis opened this issue Oct 9, 2019 · 9 comments
Assignees

Comments

@stevenlis
Copy link

Snipaste_419
nb.zip

Extension: 2019.10.41019 (8 October 2019)
Version: 1.39.0 (user setup)
Commit: 9df03c6d6ce97c6645c5846f6dfa2a6a7d276515
Date: 2019-10-09T06:58:04.439Z
Electron: 4.2.10
Chrome: 69.0.3497.128
Node.js: 10.11.0
V8: 6.9.427.31-electron.0
OS: Windows_NT x64 10.0.18362
@rchiodo
Copy link
Contributor

rchiodo commented Oct 10, 2019

Hmm. I'm not reproing this. Perhaps your version of jupyter is giving back different output than mine.

What do you get for !python -m jupyter notebook --version

@jmew
Copy link
Contributor

jmew commented Oct 10, 2019

@rchiodo I ran into this bug as well, on version 6.0.0 of Jupyter notebooks, and on public october build using this notebook:

https://gist.github.com/jmew/93c5573429e689b867a32579d2bf6281

image

@rchiodo
Copy link
Contributor

rchiodo commented Oct 10, 2019

Can you try upgrading jupyter?

conda update jupyter

I have version 6.0.1. I just ran your notebook with the released bits and I don't get the commas.

If you can still repro it with 6.0.1, then we might have to debug it on your machine @jmew

@rchiodo
Copy link
Contributor

rchiodo commented Oct 10, 2019

Actually here's my full jupyter output:

(jupyter) D:\Training>python -m jupyter --version
jupyter core     : 4.5.0
jupyter-notebook : 6.0.1
qtconsole        : 4.5.5
ipython          : 7.8.0
ipykernel        : 5.1.2
jupyter client   : 5.3.3
jupyter lab      : not installed
nbconvert        : 5.6.0
ipywidgets       : 7.5.1
nbformat         : 4.4.0
traitlets        : 4.3.3

@jmew
Copy link
Contributor

jmew commented Oct 10, 2019

Investigate how the commas go there, might be from saving from JupyterLab

@stevenlis
Copy link
Author

stevenlis commented Oct 12, 2019

@rchiodo My nb is 5.7.8 and I will try to update it later.

@rchiodo
Copy link
Contributor

rchiodo commented Oct 17, 2019

Okay this seems to be a difference in how text/html is saved by jupyter and by us

Here's a cell from jupyter:

  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>num_preg</th>\n",
       "      <th>glucose_conc</th>\n",
       "      <th>diastolic_bp</th>\n",
       "      <th>thickness</th>\n",
       "      <th>insulin</th>\n",
       "      <th>bmi</th>\n",
       "      <th>diab_pred</th>\n",
       "      <th>age</th>\n",
       "      <th>skin</th>\n",
       "      <th>diabetes</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <td>0</td>\n",
       "      <td>6</td>\n",
       "      <td>148</td>\n",
       "      <td>72</td>\n",
       "      <td>35</td>\n",
       "      <td>0</td>\n",
       "      <td>33.6</td>\n",
       "      <td>0.627</td>\n",
       "      <td>50</td>\n",
       "      <td>1.3790</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>85</td>\n",
       "      <td>66</td>\n",
       "      <td>29</td>\n",
       "      <td>0</td>\n",
       "      <td>26.6</td>\n",
       "      <td>0.351</td>\n",
       "      <td>31</td>\n",
       "      <td>1.1426</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>2</td>\n",
       "      <td>8</td>\n",
       "      <td>183</td>\n",
       "      <td>64</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>23.3</td>\n",
       "      <td>0.672</td>\n",
       "      <td>32</td>\n",
       "      <td>0.0000</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>89</td>\n",
       "      <td>66</td>\n",
       "      <td>23</td>\n",
       "      <td>94</td>\n",
       "      <td>28.1</td>\n",
       "      <td>0.167</td>\n",
       "      <td>21</td>\n",
       "      <td>0.9062</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>4</td>\n",
       "      <td>0</td>\n",
       "      <td>137</td>\n",
       "      <td>40</td>\n",
       "      <td>35</td>\n",
       "      <td>168</td>\n",
       "      <td>43.1</td>\n",
       "      <td>2.288</td>\n",
       "      <td>33</td>\n",
       "      <td>1.3790</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   num_preg  glucose_conc  diastolic_bp  thickness  insulin   bmi  diab_pred  \\\n",
       "0         6           148            72         35        0  33.6      0.627   \n",
       "1         1            85            66         29        0  26.6      0.351   \n",
       "2         8           183            64          0        0  23.3      0.672   \n",
       "3         1            89            66         23       94  28.1      0.167   \n",
       "4         0           137            40         35      168  43.1      2.288   \n",
       "\n",
       "   age    skin  diabetes  \n",
       "0   50  1.3790      True  \n",
       "1   31  1.1426     False  \n",
       "2   32  0.0000      True  \n",
       "3   21  0.9062     False  \n",
       "4   33  1.3790      True  "
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.head()"
   ]
  },

Here's the same cell after we render it:

{
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>num_preg</th>\n      <th>glucose_conc</th>\n      <th>diastolic_bp</th>\n      <th>thickness</th>\n      <th>insulin</th>\n      <th>bmi</th>\n      <th>diab_pred</th>\n      <th>age</th>\n      <th>skin</th>\n      <th>diabetes</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <td>0</td>\n      <td>6</td>\n      <td>148</td>\n      <td>72</td>\n      <td>35</td>\n      <td>0</td>\n      <td>33.6</td>\n      <td>0.627</td>\n      <td>50</td>\n      <td>1.3790</td>\n      <td>True</td>\n    </tr>\n    <tr>\n      <td>1</td>\n      <td>1</td>\n      <td>85</td>\n      <td>66</td>\n      <td>29</td>\n      <td>0</td>\n      <td>26.6</td>\n      <td>0.351</td>\n      <td>31</td>\n      <td>1.1426</td>\n      <td>False</td>\n    </tr>\n    <tr>\n      <td>2</td>\n      <td>8</td>\n      <td>183</td>\n      <td>64</td>\n      <td>0</td>\n      <td>0</td>\n      <td>23.3</td>\n      <td>0.672</td>\n      <td>32</td>\n      <td>0.0000</td>\n      <td>True</td>\n    </tr>\n    <tr>\n      <td>3</td>\n      <td>1</td>\n      <td>89</td>\n      <td>66</td>\n      <td>23</td>\n      <td>94</td>\n      <td>28.1</td>\n      <td>0.167</td>\n      <td>21</td>\n      <td>0.9062</td>\n      <td>False</td>\n    </tr>\n    <tr>\n      <td>4</td>\n      <td>0</td>\n      <td>137</td>\n      <td>40</td>\n      <td>35</td>\n      <td>168</td>\n      <td>43.1</td>\n      <td>2.288</td>\n      <td>33</td>\n      <td>1.3790</td>\n      <td>True</td>\n    </tr>\n  </tbody>\n</table>\n</div>",
      "text/plain": "   num_preg  glucose_conc  diastolic_bp  thickness  insulin   bmi  diab_pred  \\\n0         6           148            72         35        0  33.6      0.627   \n1         1            85            66         29        0  26.6      0.351   \n2         8           183            64          0        0  23.3      0.672   \n3         1            89            66         23       94  28.1      0.167   \n4         0           137            40         35      168  43.1      2.288   \n\n   age    skin  diabetes  \n0   50  1.3790      True  \n1   31  1.1426     False  \n2   32  0.0000      True  \n3   21  0.9062     False  \n4   33  1.3790      True  "
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.head()"
   ]
  },

@rchiodo
Copy link
Contributor

rchiodo commented Oct 17, 2019

Looks like the jupyter version is an nbformat.MultilineString where as ours is a plain string. We need to collapse the multiline string.

@DavidKutu
Copy link

Validated

@lock lock bot locked as resolved and limited conversation to collaborators Nov 8, 2019
@microsoft microsoft unlocked this conversation Nov 14, 2020
@DonJayamanne DonJayamanne transferred this issue from microsoft/vscode-python Nov 14, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 7, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants