Skip to content
This repository has been archived by the owner on Jan 13, 2024. It is now read-only.

Commit

Permalink
update failing notebooks
Browse files Browse the repository at this point in the history
  • Loading branch information
sdpython committed Mar 27, 2016
1 parent 58d3f78 commit d9d138c
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 9 deletions.
10 changes: 4 additions & 6 deletions _doc/notebooks/td1a/td1a_correction_session_10.ipynb
Expand Up @@ -642,9 +642,8 @@
}
],
"source": [
"from pyquickhelper.filehelper import read_url\n",
"import pandas\n",
"df = read_url(\"http://www.xavierdupre.fr/enseignement/complements/marathon.txt\",\n",
"df = pandas.read_csv(\"http://www.xavierdupre.fr/enseignement/complements/marathon.txt\",\n",
" sep=\"\\t\", names=[\"ville\", \"annee\", \"temps\",\"secondes\"])\n",
"df.head()"
]
Expand Down Expand Up @@ -1301,9 +1300,8 @@
}
],
"source": [
"from pyquickhelper.filehelper import read_url\n",
"import pandas\n",
"df = read_url(\"http://www.xavierdupre.fr/enseignement/complements/marathon.txt\",\n",
"df = pandas.read_csv(\"http://www.xavierdupre.fr/enseignement/complements/marathon.txt\",\n",
" sep=\"\\t\", names=[\"ville\", \"annee\", \"temps\",\"secondes\"])\n",
"gr = df[[\"ville\",\"secondes\"]].groupby(\"ville\", as_index=False).mean()\n",
"gr[\"annee\"] = \"moyenne\"\n",
Expand Down Expand Up @@ -1401,9 +1399,9 @@
}
],
"source": [
"from pyquickhelper.filehelper import read_url\n",
"import pandas\n",
"from datetime import datetime, time\n",
"df = read_url(\"http://www.xavierdupre.fr/enseignement/complements/marathon.txt\",\n",
"df = pandas.read_csv(\"http://www.xavierdupre.fr/enseignement/complements/marathon.txt\",\n",
" sep=\"\\t\", names=[\"ville\", \"annee\", \"temps\",\"secondes\"])\n",
"df = df [ (df[\"ville\"] == \"BERLIN\") | (df[\"ville\"] == \"PARIS\") ] \n",
"for v in [\"PARIS\",\"BERLIN\"]:\n",
Expand Down
6 changes: 3 additions & 3 deletions _doc/notebooks/td2a/td2a_correction_session_1.ipynb
Expand Up @@ -386,9 +386,9 @@
}
],
"source": [
"import pandas, urllib.request\n",
"text = url = urllib.request.urlopen(\"http://www.xavierdupre.fr/enseignement/complements/donnees_enquete_2003_television.txt\")\n",
"df = pandas.read_csv(url, sep=\"\\t\")\n",
"import pandas\n",
"url = \"http://www.xavierdupre.fr/enseignement/complements/donnees_enquete_2003_television.txt\"\n",
"df = pandas.read_csv(url, sep=\"\\t\", engine=\"python\")\n",
"df.head()"
]
},
Expand Down
16 changes: 16 additions & 0 deletions _unittests/ut_documentation/test_notebook_runner1.py
Expand Up @@ -36,6 +36,22 @@
sys.path.append(path)
import pyquickhelper as skip_

try:
import pyensae as skip__
except ImportError:
path = os.path.normpath(
os.path.abspath(
os.path.join(
os.path.split(__file__)[0],
"..",
"..",
"..",
"pyensae",
"src")))
if path not in sys.path:
sys.path.append(path)
import pyensae as skip__

from pyquickhelper.ipythonhelper.notebook_helper import run_notebook
from pyquickhelper.loghelper import fLOG
from pyquickhelper.pycode import get_temp_folder
Expand Down

0 comments on commit d9d138c

Please sign in to comment.