Commit a0f7ee66 authored by Trevor Bekolay's avatar Trevor Bekolay
Browse files

Merge branch 'gh-pages' of Mahdisadjadi/python-novice-inflammation into gh-pages

* 'gh-pages' of https://github.com/Mahdisadjadi/python-novice-inflammation:
  finding type of elements of a numpy array
parents 138e3a9a 25baa7fe
......@@ -210,7 +210,30 @@ print(type(data))
<class 'numpy.ndarray'>
~~~
The output tells us that `data` currently refers to an N-dimensional array created by the NumPy library. These data correspond to arthritis patients' inflammation. The rows are the individual patients and the columns are their daily inflammation measurements.
The output tells us that `data` currently refers to
an N-dimensional array created by the NumPy library.
These data correspond to arthritis patients' inflammation.
The rows are the individual patients and the columns
are their daily inflammation measurements.
> ## Data Type {.callout}
>
> A Numpy array contains one or more elements
> of the same type. `type` will only tell you that
> a variable is a NumPy array.
> We can also find the out the type
> of the data contained in the NumPy array.
>
> ~~~ {.python}
> print(data.dtype)
> ~~~
> ~~~ {.output}
> dtype('float64')
> ~~~
>
> This tells us that the NumPy array's elements are
> [floating-point numbers](reference.html#floating-point number).
We can see what the array's [shape](reference.html#shape) is like this:
~~~ {.python}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment