# Chapter 4 page 128

**URL:** <https://forums.kodeco.com/t/chapter-4-page-128/71035>\
**Category:** Machine Learning by Tutorials\
**Created:** [May 16, 2019, 6:52am UTC](https://forums.kodeco.com/t/chapter-4-page-128/71035 "2019-05-16T06:52:54Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![praxon48](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/praxon48/32/81494_2.png) [@praxon48](https://forums.kodeco.com/u/praxon48)\
**Post date:** [May 16, 2019, 6:52am UTC](https://forums.kodeco.com/t/chapter-4-page-128/71035/1 "2019-05-16T06:52:54Z")

</div>

![02%20PM](https://files.chunter.kodeco.com/original/3X/1/2/12eafd1df2c10c7eca475b564cc3aa67b6839f59.png)

That’s what it was displayed after typing and pressing Shift-Enter.

?data.tail(3)

The documentation was not shown.

---

<div class="post-metadata">

**Author:** ![hollance](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/hollance/32/109009_2.png) [@hollance](https://forums.kodeco.com/u/hollance)\
**Post date:** [May 16, 2019, 9:12am UTC](https://forums.kodeco.com/t/chapter-4-page-128/71035/2 "2019-05-16T09:12:18Z")

</div>

Try it without the `(3)`, so just `?data.tail`

---

<div class="post-metadata">

**Author:** ![praxon48](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/praxon48/32/81494_2.png) [@praxon48](https://forums.kodeco.com/u/praxon48)\
**Post date:** [May 16, 2019, 9:06pm UTC](https://forums.kodeco.com/t/chapter-4-page-128/71035/3 "2019-05-16T21:06:47Z")

</div>

![23%20PM](https://files.chunter.kodeco.com/original/3X/e/2/e2ecce38305d0d16e6dbeda02d07b79bee7afefc.png)

I pressed Shift-Enter with the same result.

By pressing Shift-Tab-Tab does not shown the documentation either.

---

<div class="post-metadata">

**Author:** ![clapollo](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/clapollo/32/81809_2.png) [@clapollo](https://forums.kodeco.com/u/clapollo)\
**Post date:** [May 16, 2019, 10:25pm UTC](https://forums.kodeco.com/t/chapter-4-page-128/71035/4 "2019-05-16T22:25:40Z")

</div>

Hey @praxon48,

The numbers next to your output — `In[1]` and `In[2]` — show that these are the 1st and 2nd cells that you ran, even though the cell above them claims it was the 14th cell you ran. That means you most likely restarted the kernel (perhaps you relaunched the notebook?) and then went straight to these cells to try running them. But that won’t work because you haven’t actually created the `data` object yet.

Jupiter notebooks can be misleading because they save any displayed output in the file, however, the _variables_ are actually only stored in memory. So when you restart a notebook, it will no longer have anything in memory, even though the file still appears to include all the output.

I recommend you go to the `Kernel` menu and choose `Restart` — or even `Restart and Clear Output` to get rid of all the old outputs — and then re-run every cell starting at the beginning of the notebook.

I hope this helps!

-Chris

---

<div class="post-metadata">

**Author:** ![praxon48](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/praxon48/32/81494_2.png) [@praxon48](https://forums.kodeco.com/u/praxon48)\
**Post date:** [May 16, 2019, 10:59pm UTC](https://forums.kodeco.com/t/chapter-4-page-128/71035/5 "2019-05-16T22:59:23Z")

</div>

I follow your advice and this is what I got:

![27%20PM](https://files.chunter.kodeco.com/original/3X/4/1/41b2e906b6c22abf06b163e107d6d9ea58f2d947.png)

SHIFT-TAB-TAB is working, but as you can see the code in cell three does not when using the question mark ?data.tail(3) and SHIFT-ENTER.

---

<div class="post-metadata">

**Author:** ![clapollo](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/clapollo/32/81809_2.png) [@clapollo](https://forums.kodeco.com/u/clapollo)\
**Post date:** [May 16, 2019, 11:55pm UTC](https://forums.kodeco.com/t/chapter-4-page-128/71035/6 "2019-05-16T23:55:21Z")

</div>

Hmm. Sorry, then I honestly have no idea why that’s happening. It works when I run it, but I know hearing “it works on my machine” isn’t very helpful. ☹

I wonder, does the `?` trick work with anything else? For example, does running a cell containing

```auto
?list

```

show any docstring or does it report an error, too?

---

<div class="post-metadata">

**Author:** ![praxon48](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/praxon48/32/81494_2.png) [@praxon48](https://forums.kodeco.com/u/praxon48)\
**Post date:** [May 17, 2019, 12:02am UTC](https://forums.kodeco.com/t/chapter-4-page-128/71035/7 "2019-05-17T00:02:29Z")

</div>

It works with the command. ?list but not with the other one. I can continue without that trick.

Thank You!!!

---

<div class="post-metadata">

**Author:** ![hollance](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/hollance/32/109009_2.png) [@hollance](https://forums.kodeco.com/u/hollance)\
**Post date:** [May 17, 2019, 9:08am UTC](https://forums.kodeco.com/t/chapter-4-page-128/71035/8 "2019-05-17T09:08:51Z")

</div>

For me, `?data.tail(3)` also doesn’t work but `?data.tail` does. This might be a versioning thing where it may work with some version of Jupyter/Python but not with others.

When I do `conda list` it shows:

```
jupyter_client 5.2.4 py36_0  
jupyter_core 4.4.0 py36_0  
notebook 5.7.6 py36_0
pandas 0.24.2 py36h0a44026_0  

```

@clapollo @praxon48 What does this show for you?

---

<div class="post-metadata">

**Author:** ![praxon48](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/praxon48/32/81494_2.png) [@praxon48](https://forums.kodeco.com/u/praxon48)\
**Post date:** [May 17, 2019, 11:22am UTC](https://forums.kodeco.com/t/chapter-4-page-128/71035/9 "2019-05-17T11:22:35Z")

</div>

jupyter\_client 5.2.4 py37\_0  
jupyter\_core 4.4.0 py37\_0  
notebook 5.7.8 py37\_0  
pandas 0.24.2 py37h0a44026\_0

---

<div class="post-metadata">

**Author:** ![clapollo](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/clapollo/32/81809_2.png) [@clapollo](https://forums.kodeco.com/u/clapollo)\
**Post date:** [May 17, 2019, 10:05pm UTC](https://forums.kodeco.com/t/chapter-4-page-128/71035/10 "2019-05-17T22:05:02Z")

</div>

@hollance: I tried it on two setups:

For this one, it only works with `?data.tail`

```auto
jupyter_client 5.2.4 py36_0
jupyter_core 4.4.0 py36_0
notebook 5.7.4 py36_0 
pandas 0.24.2 py36he6710b0_0

```

For this one, it works both as `?data.tail`, `?data.tail()` and `?data.tail(3)`:

```auto
jupyter_client 5.1.0 py27_0
jupyter_core 4.3.0 py27_0
notebook 5.0.0 py27_0
pandas 0.24.2 py27h0a44026_0

```

Notice I used two very different environments and the `?` worked differently in each. I see @praxon48 is using Python 3.7 and a version of `notebook` newer than either of us. My guess is that’s what’s causing the issue.

---

<div class="post-metadata">

**Author:** ![praxon48](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/praxon48/32/81494_2.png) [@praxon48](https://forums.kodeco.com/u/praxon48)\
**Post date:** [May 18, 2019, 12:30am UTC](https://forums.kodeco.com/t/chapter-4-page-128/71035/11 "2019-05-18T00:30:39Z")

</div>

The ebook instructs to download Python 3.7 and the version of Python at the Anaconda’s download page is Python 3.7.

What version of Python should I install? Should I download a specificities version of Python directly from [Python.org](http://Python.org)?  
What version of python are you using, I would like to download that version to be compatible with the exercises in the ebook.

I’m going to reinstall my system to do chapter 4 again, if you can provide the terminal commands or some instruction to have the correct software versions installed to follow with the book will be really helpful.

Thank you!

---

<div class="post-metadata">

**Author:** ![praxon48](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/praxon48/32/81494_2.png) [@praxon48](https://forums.kodeco.com/u/praxon48)\
**Post date:** [May 18, 2019, 4:47am UTC](https://forums.kodeco.com/t/chapter-4-page-128/71035/12 "2019-05-18T04:47:12Z")

</div>

Installed Python 3.6 and it works with ?data.tail only.

---

<div class="post-metadata">

**Author:** ![hollance](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/hollance/32/109009_2.png) [@hollance](https://forums.kodeco.com/u/hollance)\
**Post date:** [May 18, 2019, 10:15am UTC](https://forums.kodeco.com/t/chapter-4-page-128/71035/13 "2019-05-18T10:15:21Z")

</div>

> [@praxon48](#):
>
> The ebook instructs to download Python 3.7 and the version of Python at the Anaconda’s download page is Python 3.7.

The download for Anaconda is for Python 3.7, but it still allows you to install Python 3.6. The book has been written with 3.6 in mind, and some of the packages (such as coremltools, turicreate, etc) may not work with 3.7 yet (or didn’t when we wrote the book).

It’s a bit confusing that you have to download Anacoda for Python 3.7 and then install Python 3.6 into your environment, but that’s the preferred approach.

However, if you don’t want to use Anaconda, you can also use Python 3.6 (from homebrew, for example) and install all the packages using pip. But it’s _really easy_ to make a mess of your packages, which is why we recommend Anaconda.

---

<div class="post-metadata">

**Author:** ![praxon48](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/praxon48/32/81494_2.png) [@praxon48](https://forums.kodeco.com/u/praxon48)\
**Post date:** [May 19, 2019, 1:01am UTC](https://forums.kodeco.com/t/chapter-4-page-128/71035/14 "2019-05-19T01:01:09Z")

</div>

I followed the the instructions in the book very carefully many times with the same results that I had posted in the last 3 days. The good thing is that I’m getting good at creating and deleting environments. In fact I have burning the midnight oil and improve my understanding of machine learning by trouble shooting and searching more info with google. So far so good. Before reading the ebook it was a mystery Machine Learning and all its tools. That thought has change. I’m learning.

Thank you!
