<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
* {box-sizing: border-box}
body 
<!--- {font-family: Verdana, sans-serif; margin:0}   ---- Cheung -->
.mySlides {display: none}
img {vertical-align: middle;}

/* Slideshow container */
.slideshow-container {
  max-width: 1200px;
  position: relative;
  margin: auto;
}

/* Next & previous buttons */
.prev, .next {
  cursor: pointer;
  position: absolute;
  top: 50%;
  width: auto;
  padding: 16px;
  margin-top: -22px;
  color: white;
  font-weight: bold;
  font-size: 18px;
  transition: 0.6s ease;
  border-radius: 0 3px 3px 0;
  user-select: none;
}

/* Position the "next button" to the right */
.next {
  right: 0;
  border-radius: 3px 0 0 3px;
}

/* On hover, add a black background color with a little bit see-through */
.prev:hover, .next:hover {
  background-color: rgba(0,0,0,0.8);
}

/* Caption text --- Originally: top: -35px;  Cheung */

.text {
  color: #f2f2f2;
  font-size: 15px;
  padding: 8px 12px;
  position: absolute;
  top: -55px;
  width: 100%;
  text-align: center;
}

/* Number text (1/3 etc) */
.numbertext {
  color: #f2f2f2;
  font-size: 12px;
  padding: 8px 12px;
  position: absolute;
  top: 0;
}

/* The dots/bullets/indicators */
.dot {
  cursor: pointer;
  height: 15px;
  width: 15px;
  margin: 0 2px;
  background-color: #bbb;
  border-radius: 50%;
  display: inline-block;
  transition: background-color 0.6s ease;
}

.active, .dot:hover {
  background-color: #717171;
}

/* Fading animation */
.fade {
  -webkit-animation-name: fade;
  -webkit-animation-duration: 1.5s;
  animation-name: fade;
  animation-duration: 1.5s;
}

@-webkit-keyframes fade {
  from {opacity: .4} 
  to {opacity: 1}
}

@keyframes fade {
  from {opacity: .4} 
  to {opacity: 1}
}

/* On smaller screens, decrease text size */
@media only screen and (max-width: 300px) {
  .prev, .next,.text {font-size: 11px}
}

text = "#000000"
link="#00ff00"
vlink="#f00000"
bgcolor="#ffffff"
</style>

<!------------------------------ POP UP ------------------------>

<style>
/* Popup container - can be anything you want */
.popup {
  position: relative;
  display: inline-block;
  cursor: pointer;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

/* The actual popup */
.popup .popuptext {
  visibility: hidden;
  width: 600px;
  background-color: #333;
  color: #fff;
  text-align: left;
  border-radius: 6px;
  padding: 8px 0;
  position: absolute;
  z-index: 1;
  bottom: 125%;
  left: 50%;
  margin-left: -80px;
}

/* Popup arrow */
.popup .popuptext::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: #555 transparent transparent transparent;
}

/* Toggle this class - hide and show the popup */
.popup .show {
  visibility: visible;
  -webkit-animation: fadeIn 1s;
  animation: fadeIn 1s;
}

/* Add animation (fade in the popup) */
@-webkit-keyframes fadeIn {
  from {opacity: 0;} 
  to {opacity: 1;}
}

@keyframes fadeIn {
  from {opacity: 0;}
  to {opacity:1 ;}
}
</style>

<!------------------------------ POP UP ------------------------>





</head>

<!-- ------------------------------------------------------------------- -->

<body>



<body
text = "#000000"
link="#00ff00"
vlink="#f00000"
bgcolor="#ffffff"
>

<!---------------  Changes the first line height in slide -------------->
&nbsp;
<P>
&nbsp;

<!-- Slideshow container -->
<div class="slideshow-container">

<!-- Full-width images with number and caption text -->



<!-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx -->



<div class="mySlides">
  <!------------------ Title ------------------>
  <div class="text">
  <FONT color="red" size=+2><B>
  <SPAN style="BACKGROUND-COLOR: yellow">

  <FONT color="yellow"><B>
  <SPAN style="BACKGROUND-COLOR: #000000"> &nbsp;
  Series
  &nbsp; </SPAN>
  </B></FONT>

  </SPAN>
  </B></FONT>
  </div>

  <!------------------ Optional header ------------------>
  <p style="margin-left: 0.6in">
  <font size="+2">
  </font>
  </p>

  <!------------------ Slide ------------------>
  <center>
  <TABLE bgcolor="lightcyan" BORDER="5" width=950>
  <TR> <TD>
  <font size="+2">
  <UL>
  <LI> <FONT color="red"><B>Series</B></FONT>
     is a <FONT color="blue"><B>one-dimensional</B></FONT>
      <FONT color="red"><B>array-like structure</B></FONT>
      containing
    <SPAN style="BACKGROUND-COLOR: #000000">
    <FONT COLOR="yellow"><B>homogeneous data</B></FONT></SPAN>.
<P>
 <LI> <FONT color="red"><B>Example</B></FONT> of a
  <FONT color="blue"><B>series</B></FONT>:
<P>
<CENTER>
<TABLE bgcolor="lightyellow" BORDER="5" width=800>
<TR> <TD>

<FONT color="blue" size="+2">
<B>
<PRE>
  10 	23    56    17    52   61   73    90    26    72
</PRE>
</B>
</FONT>

</TD> </TR>
</TABLE>
</CENTER>
<P>
<LI> <FONT color="red"><B>Key Points</B></FONT>:
<P>
<CENTER>
<TABLE bgcolor="lightyellow" BORDER="5" width=800>
<TR> <TD>
<FONT SIZE="+2">

 <UL>
 <LI> <FONT color="red"><B>Homogeneous data</B></FONT>
    (<FONT color="blue"><B>all elements</B></FONT> in
    <FONT color="red"><B>series</B></FONT> has the
    <FONT color="blue"><B>same</B></FONT>
    <FONT color="red"><B>data type</B></FONT>)
 <P>
 <LI> <FONT color="red"><B>Size</B></FONT> of a
     <FONT color="blue"><B>series</B></FONT> is
     <FONT color="red"><B>immutable</B></FONT>
 <P>
 <LI> <FONT color="red"><B>Values</B></FONT> <B>stored</B> in a
   <FONT color="blue"><B>series</B></FONT> are
     <FONT color="red"><B>mutable</B></FONT>
 </UL>

</FONT>
</TD> </TR>
</TABLE>
</CENTER>
<P>

  </UL>
  </font>
  </TD> </TR>
  </TABLE>
  </center>

  <!------------------ Optional footer ------------------>
  <p style="margin-left: 0.6in">
  <font size="+2">
  </font>
  </p>

  <!------------------ Spacing ------------------>
  <p style="padding: 0.0in">
  </p>
</div>



<div class="mySlides">
  <!------------------ Title ------------------>
  <div class="text">
  <FONT color="red" size=+2><B>
  <SPAN style="BACKGROUND-COLOR: yellow">

  <FONT color="yellow"><B>
  <SPAN style="BACKGROUND-COLOR: #000000"> &nbsp;
  Defining a <FONT color="lightblue">series</FONT> object
  &nbsp; </SPAN>
  </B></FONT>

  </SPAN>
  </B></FONT>
  </div>

  <!------------------ Optional header ------------------>
  <p style="margin-left: 0.6in">
  <font size="+2">
  </font>
  </p>

  <!------------------ Slide ------------------>
  <center>
  <TABLE bgcolor="lightcyan" BORDER="5" width=950>
  <TR> <TD>
  <font size="+2">
  <UL>
  <LI> <FONT color="red"><B>Syntax</B></FONT>:
<P>
<CENTER>
<TABLE bgcolor="lightyellow" BORDER="5" width=800>
<TR> <TD>

<FONT color="blue" size="+2">
<B>
<PRE>
  seriesVar = pandas.Series( data, index, dtype, copy)
</PRE>
</B>
</FONT>

</TD> </TR>
</TABLE>
</CENTER>
<P>
The <FONT color="red"><B>parameters</B></FONT>
    of the <FONT color="blue"><B>constructor</B></FONT> are:
<P>
<CENTER>
<TABLE bgcolor="#CCFFCC" BORDER="5" width=800>
<TR> <TD>
<FONT SIZE="+2">

 <UL>
 <LI> <FONT color="red"><B><TT>data</TT></B></FONT>:  &nbsp;

       <FONT color="blue"><B>various forms</B></FONT>, 
  <B>e.g.:</B> a <FONT color="red"><B>list</B></FONT> 
 <P>
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
   <SPAN style="BACKGROUND-COLOR: #000000">
   <FONT COLOR="yellow"><B>Default:</B></FONT></SPAN>&nbsp;
   <FONT color="red"><B><TT>[ ]</TT></B></FONT>
<P>
 <LI> <FONT color="red"><B><TT>index</TT></B></FONT>: &nbsp;

   <FONT color="blue"><B>index values</B></FONT>
   must be <FONT color="red"><B>unique</B></FONT> and
   <FONT color="blue"><B>hashable</B></FONT>, 
   <SPAN style="BACKGROUND-COLOR: #000000">
   <FONT COLOR="yellow"><B>same length</B></FONT></SPAN>
   as <FONT color="red"><B><TT>data</TT></B></FONT>. 
<P>
 <P>
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  <SPAN style="BACKGROUND-COLOR: #000000">
  <FONT COLOR="yellow"><B>Default:</B></FONT></SPAN> &nbsp;
   <FONT color="red"><B><TT>np.arrange(n)</TT></B></FONT>,
   <B>i.e.:</B> <FONT color="red"><B><TT>[0 .. (n-1)]</TT></B></FONT>

<P>
<LI> <FONT color="red"><B><TT>dtype:</TT></B></FONT> &nbsp;

    <FONT color="blue"><B> data type</B></FONT>. 
 <P>
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <SPAN style="BACKGROUND-COLOR: #000000">
    <FONT COLOR="yellow"><B>Default:</B></FONT></SPAN> &nbsp;
     <FONT color="red"><B>data type</B></FONT>
     is <FONT color="blue"><B> inferred</B></FONT> from
     <FONT color="red"><B><TT>data</TT></B></FONT>

<P>
<LI> <FONT color="red"><B><TT>copy:</TT></B></FONT> &nbsp;

    <FONT color="blue"><B>copy data</B></FONT>. 
 <P>
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <SPAN style="BACKGROUND-COLOR: #000000">
    <FONT COLOR="yellow"><B>Default:</B></FONT></SPAN> &nbsp;
     <FONT color="red"><B>False</B></FONT>
 
 </UL>

</FONT>
</TD> </TR>
</TABLE>
</CENTER>
<P>

  </UL>
  </font>
  </TD> </TR>
  </TABLE>
  </center>

  <!------------------ Optional footer ------------------>
  <p style="margin-left: 0.6in">
  <font size="+2">
  </font>
  </p>

  <!------------------ Spacing ------------------>
  <p style="padding: 0.0in">
  </p>
</div>




<div class="mySlides">
  <!------------------ Title ------------------>
  <div class="text">
  <FONT color="red" size=+2><B>
  <SPAN style="BACKGROUND-COLOR: yellow">

  <FONT color="yellow"><B>
  <SPAN style="BACKGROUND-COLOR: #000000"> &nbsp;
  Creating  <FONT color="lightblue">Series</FONT> objects
  &nbsp; </SPAN>
  </B></FONT>

  </SPAN>
  </B></FONT>
  </div>

  <!------------------ Optional header ------------------>
  <p style="margin-left: 0.6in">
  <font size="+2">
  </font>
  </p>

  <!------------------ Slide ------------------>
  <center>
  <TABLE bgcolor="lightcyan" BORDER="5" width=950>
  <TR> <TD>
  <font size="+2">
  <UL>
  <LI> <FONT color="red"><B>How to</B></FONT> 
     <FONT color="blue"><B>create</B></FONT> an
     <FONT color="red"><B>empty</B></FONT>
     <FONT color="blue"><B><TT>series</TT></B></FONT>:
<P>
<CENTER>
<TABLE bgcolor="lightyellow" BORDER="5" width=800>
<TR> <TD>

<FONT color="blue" size="+2">
<B>
<PRE>
#import the pandas library and aliasing as pd
import pandas as pd

s1 = pd.<FONT color="red">Series()</FONT>
print(s1)                 # Output: <FONT color="red">Series([], dtype: float64)
</FONT>
</PRE>
</B>
</FONT>

</TD> </TR>
</TABLE>
</CENTER>
<P>
<HR>
<P>
<LI> <FONT color="red"><B>How to</B></FONT> 
     <FONT color="blue"><B>create</B></FONT> a
     <FONT color="red"><B><TT>series</TT></B></FONT> with
   a <FONT color="blue"><B>Python</B></FONT>
   <FONT color="red"><B>list</B></FONT>:
<P>
<CENTER>
<TABLE bgcolor="lightyellow" BORDER="5" width=800>
<TR> <TD>

<FONT color="blue" size="+2">
<B>
<PRE>
#import the pandas library and aliasing as pd
import pandas as pd

s2 = pd.<FONT color="red">Series([9, 8])</FONT>
print(s2)                 

<FONT color="red">Output:</FONT>    0    9             (0, 1 are <FONT color="red">indexes</FONT>)
           1    8
           dtype: int64</FONT>
</PRE>
</B>
</FONT>

</TD> </TR>
</TABLE>
</CENTER>
<P>


  </UL>
  </font>
  </TD> </TR>
  </TABLE>
  </center>

  <!------------------ Optional footer ------------------>
  <p style="margin-left: 0.6in">
  <font size="+2">
   <FONT color="red"><B>DEMO:</B></FONT>
  <FONT color="blue"><B><TT>progs/series01.py</TT></B></FONT>
  </font>
  </p>

  <!------------------ Spacing ------------------>
  <p style="padding: 0.0in">
  </p>
</div>





<div class="mySlides">
  <!------------------ Title ------------------>
  <div class="text">
  <FONT color="red" size=+2><B>
  <SPAN style="BACKGROUND-COLOR: yellow">

  <FONT color="yellow"><B>
  <SPAN style="BACKGROUND-COLOR: #000000"> &nbsp;
  Using your own 
  <FONT color="lightblue">indexes</FONT>
  &nbsp; </SPAN>
  </B></FONT>

  </SPAN>
  </B></FONT>
  </div>

  <!------------------ Optional header ------------------>
  <p style="margin-left: 0.6in">
  <font size="+2">
  </font>
  </p>

  <!------------------ Slide ------------------>
  <center>
  <TABLE bgcolor="lightcyan" BORDER="5" width=950>
  <TR> <TD>
  <font size="+2">
  <UL>
  <LI> <FONT color="red"><B>How to</B></FONT> 
     <FONT color="blue"><B>create</B></FONT>
     <FONT color="red"><B><TT>series</TT></B></FONT>
     with your <FONT color="blue"><B>own</B></FONT>
     <FONT color="red"><B>indexes</B></FONT>:
<P>
<CENTER>
<TABLE bgcolor="lightyellow" BORDER="5" width=800>
<TR> <TD>

<FONT color="blue" size="+2">
<B>
<PRE>
data = ['a', b', 'c']

s1 = pd.<FONT color="red">Series(data,index=[100,101,99])</FONT>
print(s1)

<FONT color="red">Output:</FONT>
          100    a
          101    b
          99     c
          dtype: object
</FONT>
</PRE>
</B>
</FONT>

</TD> </TR>
</TABLE>
</CENTER>
<P>
<LI> You can <FONT color="red"><B>use</B></FONT>
     <SPAN style="BACKGROUND-COLOR: #000000">
     <FONT COLOR="yellow"><B>symbols</B></FONT></SPAN> as
     <FONT color="blue"><B>index</B></FONT>:
<P>
<CENTER>
<TABLE bgcolor="lightyellow" BORDER="5" width=800>
<TR> <TD>

<FONT color="blue" size="+2">
<B>
<PRE>
s2 = pd.Series(data, <FONT color="red">['x', 'y', 'z']</FONT>)
print(s2)

<FONT color="red">Output:</FONT>
        x    a
	y    b
	z    c
	dtype: object
</PRE>
</B>
</FONT>

</TD> </TR>
</TABLE>
</CENTER>
<P>


  </UL>
  </font>
  </TD> </TR>
  </TABLE>
  </center>

  <!------------------ Optional footer ------------------>
  <p style="margin-left: 0.6in">
  <font size="+2">
  </font>
  </p>

  <!------------------ Spacing ------------------>
  <p style="padding: 0.0in">
  </p>
</div>



<div class="mySlides">
  <!------------------ Title ------------------>
  <div class="text">
  <FONT color="red" size=+2><B>
  <SPAN style="BACKGROUND-COLOR: yellow">

  <FONT color="yellow"><B>
  <SPAN style="BACKGROUND-COLOR: #000000"> &nbsp;
  Create a <FONT color="lightblue">Series</FONT> from 
   <FONT color="orange">dict</FONT>
  &nbsp; </SPAN>
  </B></FONT>

  </SPAN>
  </B></FONT>
  </div>

  <!------------------ Optional header ------------------>
  <p style="margin-left: 0.6in">
  <font size="+2">
  </font>
  </p>

  <!------------------ Slide ------------------>
  <center>
  <TABLE bgcolor="lightcyan" BORDER="5" width=950>
  <TR> <TD>
  <font size="+2">
  <UL>
  <LI> A <FONT color="red"><B><TT>dict</TT></B></FONT> can be used
      as <FONT color="blue"><B>input</B></FONT> to
      <B>construct</B> a <FONT color="red"><B>series</B></FONT>
<P>
<CENTER>
<TABLE bgcolor="#CCFFCC" BORDER="5" width=800>
<TR> <TD>
<FONT SIZE="+2">

 <UL>
 <LI> If <FONT color="red"><B>no</B></FONT>
     <FONT color="blue"><B><TT>index</TT></B></FONT> is 
     <FONT color="red"><B>specified</B></FONT>:
<P>
<CENTER>
<TABLE bgcolor="lightyellow" BORDER="5" width=700>
<TR> <TD>
<FONT SIZE="+2">

 <UL>
 <LI> the <FONT color="red"><B>dictionary keys</B></FONT>
     are <FONT color="blue"><B>used</B></FONT> as
       <FONT color="red"><B>index</B></FONT>
 </UL>

</FONT>
</TD> </TR>
</TABLE>
</CENTER>
<P>

<LI> If
     <FONT color="red"><B><TT>index</TT></B></FONT> is 
     <FONT color="blue"><B>passed</B></FONT>:
<P>
<CENTER>
<TABLE bgcolor="lightyellow" BORDER="5" width=700>
<TR> <TD>
<FONT SIZE="+2">

 <UL>
 <LI> the <FONT color="red"><B>values</B></FONT>
    in the <B>input</B>
   <FONT color="blue"><B><TT>data</TT></B></FONT> 
   <FONT color="red"><B>corresponding</B></FONT>
   to the <FONT color="blue"><B>labels</B></FONT> in the 
    <FONT color="red"><B><TT>index</TT></B></FONT> will be 
   <SPAN style="BACKGROUND-COLOR: #000000">
   <FONT COLOR="yellow"><B>pulled out</B></FONT></SPAN>

 </UL>

</FONT>
</TD> </TR>
</TABLE>
</CENTER>
<P>


 </UL>

</FONT>
</TD> </TR>
</TABLE>
</CENTER>
<P>
<B>Example:</B> <FONT color="red"><B>no</B></FONT>
   <FONT color="blue"><B><TT>index</TT></B></FONT> specified
<P>
<CENTER>
<TABLE bgcolor="lightyellow" BORDER="5" width=800>
<TR> <TD>

<FONT color="blue" size="+2">
<B>
<PRE>
data = {'a' : 0.0, 'b' : 1.0, 'c' : 2.0}
s = pd.Series(data)

print(s)

<FONT color="red">Output:</FONT>
        a    0.0
	b    1.0
	c    2.0
	dtype: float64
</PRE>
</B>
</FONT>

</TD> </TR>
</TABLE>
</CENTER>
<P>




  </UL>
  </font>
  </TD> </TR>
  </TABLE>
  </center>

  <!------------------ Optional footer ------------------>
  <p style="margin-left: 0.6in">
  <font size="+2">
  <FONT color="red"><B>Demo:</B></FONT>
  <FONT color="blue"><B><TT>
  progs/series03.py</TT></B></FONT>
  </font>
  </p>

  <!------------------ Spacing ------------------>
  <p style="padding: 0.0in">
  </p>
</div>



<div class="mySlides">
  <!------------------ Title ------------------>
  <div class="text">
  <FONT color="red" size=+2><B>
  <SPAN style="BACKGROUND-COLOR: yellow">

  <FONT color="yellow"><B>
  <SPAN style="BACKGROUND-COLOR: #000000"> &nbsp;
  Create a <FONT color="lightblue">Series</FONT> from 
   <FONT color="orange">dict</FONT>
  &nbsp; </SPAN>
  </B></FONT>

  </SPAN>
  </B></FONT>
  </div>

  <!------------------ Optional header ------------------>
  <p style="margin-left: 0.6in">
  <font size="+2">
  </font>
  </p>

  <!------------------ Slide ------------------>
  <center>
  <TABLE bgcolor="lightcyan" BORDER="5" width=950>
  <TR> <TD>
  <font size="+2">
  <UL>
  <LI> A <FONT color="red"><B><TT>dict</TT></B></FONT> can be used
      as <FONT color="blue"><B>input</B></FONT> to
      <B>construct</B> a <FONT color="red"><B>series</B></FONT>
<P>
<CENTER>
<TABLE bgcolor="#CCFFCC" BORDER="5" width=800>
<TR> <TD>
<FONT SIZE="+2">

 <UL>
 <LI> If <FONT color="red"><B>no</B></FONT>
     <FONT color="blue"><B><TT>index</TT></B></FONT> is 
     <FONT color="red"><B>specified</B></FONT>:
<P>
<CENTER>
<TABLE bgcolor="lightyellow" BORDER="5" width=700>
<TR> <TD>
<FONT SIZE="+2">

 <UL>
 <LI> the <FONT color="red"><B>dictionary keys</B></FONT>
     are <FONT color="blue"><B>used</B></FONT> as
       <FONT color="red"><B>index</B></FONT>
 </UL>

</FONT>
</TD> </TR>
</TABLE>
</CENTER>
<P>

<LI> If
     <FONT color="red"><B><TT>index</TT></B></FONT> is 
     <FONT color="blue"><B>passed</B></FONT>:
<P>
<CENTER>
<TABLE bgcolor="lightyellow" BORDER="5" width=700>
<TR> <TD>
<FONT SIZE="+2">

 <UL>
 <LI> the <FONT color="red"><B>values</B></FONT>
    in the <B>input</B>
   <FONT color="blue"><B><TT>data</TT></B></FONT> 
   <FONT color="red"><B>corresponding</B></FONT>
   to the <FONT color="blue"><B>labels</B></FONT> in the 
    <FONT color="red"><B><TT>index</TT></B></FONT> will be 
   <SPAN style="BACKGROUND-COLOR: #000000">
   <FONT COLOR="yellow"><B>pulled out</B></FONT></SPAN>

 </UL>

</FONT>
</TD> </TR>
</TABLE>
</CENTER>
<P>


 </UL>

</FONT>
</TD> </TR>
</TABLE>
</CENTER>
<P>
<B>Example:</B> 
   <FONT color="red"><B><TT>index</TT></B></FONT> is
   <FONT color="blue"><B>passed</B></FONT>
<P>
<CENTER>
<TABLE bgcolor="lightyellow" BORDER="5" width=800>
<TR> <TD>

<FONT color="blue" size="+2">
<B>
<PRE>
data = {'a' : 0.0, 'b' : 1.0, 'c' : 2.0}
s = pd.Series(data, <FONT color="red">['c', 'b', 'a', 'd']</FONT>)

print(s)

<FONT color="red">Output:</FONT>
        c    2.0
	b    1.0
	a    0.0
	d    NaN</PRE>
</B>
</FONT>

</TD> </TR>
</TABLE>
</CENTER>
<P>




  </UL>
  </font>
  </TD> </TR>
  </TABLE>
  </center>

  <!------------------ Optional footer ------------------>
  <p style="margin-left: 0.6in">
  <font size="+2">
  <FONT color="red"><B>Demo:</B></FONT>
  <FONT color="blue"><B><TT>
  progs/series03.py</TT></B></FONT>
  </font>
  </p>

  <!------------------ Spacing ------------------>
  <p style="padding: 0.0in">
  </p>
</div>






<div class="mySlides">
  <!------------------ Title ------------------>
  <div class="text">
  <FONT color="red" size=+2><B>
  <SPAN style="BACKGROUND-COLOR: yellow">

  <FONT color="yellow"><B>
  <SPAN style="BACKGROUND-COLOR: #000000"> &nbsp;
  <FONT color="lightblue">Accessing Data</FONT>
    from Series with <FONT color="orange">Position</FONT>
    and with <FONT color="orange">Index</FONT>
  &nbsp; </SPAN>
  </B></FONT>

  </SPAN>
  </B></FONT>
  </div>

  <!------------------ Optional header ------------------>
  <p style="margin-left: 0.6in">
  <font size="+2">
  </font>
  </p>

  <!------------------ Slide ------------------>
  <center>
  <TABLE bgcolor="lightcyan" BORDER="5" width=950>
  <TR> <TD>
  <font size="+2">
  <UL>
  <LI> <FONT color="red"><B>Syntax</B></FONT> to
    <FONT color="blue"><B>access</B></FONT>
   the <FONT color="red"><B><TT>k-th</TT></B></FONT>
   <B>element</B> in a <FONT color="blue"><B>series</B></FONT>
   by its <SPAN style="BACKGROUND-COLOR: #000000">
   <FONT COLOR="yellow"><B>position <TT>k</TT></B></FONT></SPAN>:
<P>
<CENTER>
<TABLE bgcolor="lightyellow" BORDER="5" width=800>
<TR> <TD>

<FONT color="blue" size="+2">
<B>
<PRE>
     seriesVar[ <FONT color="red">k</FONT> ]
</PRE>
</B>
</FONT>

</TD> </TR>
</TABLE>
</CENTER>
<P>

  <LI> <FONT color="red"><B>Syntax</B></FONT> to
    <FONT color="blue"><B>access</B></FONT>
   an <FONT color="red"><B>element</B></FONT>
    in a <FONT color="blue"><B>series</B></FONT>
   by its <SPAN style="BACKGROUND-COLOR: #000000">
   <FONT COLOR="yellow"><B>index <TT>index</TT></B></FONT></SPAN>:
<P>
<CENTER>
<TABLE bgcolor="lightyellow" BORDER="5" width=800>
<TR> <TD>

<FONT color="blue" size="+2">
<B>
<PRE>
     seriesVar[ <FONT color="red">index</FONT> ]
</PRE>
</B>
</FONT>

</TD> </TR>
</TABLE>
</CENTER>
<P>



<B>Example:</B>
<P>
<CENTER>
<TABLE bgcolor="#CCFFCC" BORDER="5" width=800>
<TR> <TD>

<FONT color="blue" size="+2">
<B>
<PRE>
s1 = pd.Series([4,5,6,7,8], <FONT color="red">index</FONT> = <FONT color="red">['a','b','c','d','e']</FONT>)

print(s1[0])             ---> 4
print(s1[4])             ---> 8

print(s1['a'])           ---> 4
print(s1['e'])           ---> 8
</PRE>
</B>
</FONT>

</TD> </TR>
</TABLE>
</CENTER>
<P>
<SPAN style="BACKGROUND-COLOR: #000000">
<FONT COLOR="yellow"><B>Comment:</B></FONT></SPAN> &nbsp;
  a <FONT color="red"><B><TT>series</TT></B></FONT> is
  <FONT color="blue"><B>similar</B></FONT> to
  a <FONT color="red"><B>Python <TT>dict</TT></B></FONT>... 
  but can <B>also</B> use
  <FONT color="blue"><B>positional "index"</B></FONT>
  </UL>
  </font>
  </TD> </TR>
  </TABLE>
  </center>

  <!------------------ Optional footer ------------------>
  <p style="margin-left: 0.6in">
  <font size="+2">
  </font>
  </p>

  <!------------------ Spacing ------------------>
  <p style="padding: 0.0in">
  </p>
</div>




<div class="mySlides">
  <!------------------ Title ------------------>
  <div class="text">
  <FONT color="red" size=+2><B>
  <SPAN style="BACKGROUND-COLOR: yellow">

  <FONT color="yellow"><B>
  <SPAN style="BACKGROUND-COLOR: #000000"> &nbsp;
  <FONT color="lightblue">Array slices</FONT>
   with <FONT color="orange">positional index</FONT>
  &nbsp; </SPAN>
  </B></FONT>

  </SPAN>
  </B></FONT>
  </div>

  <!------------------ Optional header ------------------>
  <p style="margin-left: 0.6in">
  <font size="+2">
  </font>
  </p>

  <!------------------ Slide ------------------>
  <center>
  <TABLE bgcolor="lightcyan" BORDER="5" width=950>
  <TR> <TD>
  <font size="+2">
  <UL>
  <LI> <B>Examples:</B>
<P>
<CENTER>
<TABLE bgcolor="lightyellow" BORDER="5" width=800>
<TR> <TD>

<FONT color="blue" size="+2">
<B>
<PRE>
s = pd.Series([1,2,3,4,5],index = ['a','b','c','d','e'])

print s[<FONT color="red">1:3</FONT>]            
                b    5
		c    6

print(s[<FONT color="red">1:</FONT>])
                b    5
		c    6
		d    7
		e    8

print(s[<FONT color="red">:3</FONT>])
                a    4
		b    5
		c    6
</PRE>
</B>
</FONT>

</TD> </TR>
</TABLE>
</CENTER>
<P>

  </UL>
  </font>
  </TD> </TR>
  </TABLE>
  </center>

  <!------------------ Optional footer ------------------>
  <p style="margin-left: 0.6in">
  <font size="+2">
  <FONT color="red"><B>DEMO:</B></FONT>
  <FONT color="blue"><B><TT>progs/series05.py</TT></B></FONT>
  </font>
  </p>

  <!------------------ Spacing ------------------>
  <p style="padding: 0.0in">
  </p>
</div>




<div class="mySlides">
  <!------------------ Title ------------------>
  <div class="text">
  <FONT color="red" size=+2><B>
  <SPAN style="BACKGROUND-COLOR: yellow">

  <FONT color="yellow"><B>
  <SPAN style="BACKGROUND-COLOR: #000000"> &nbsp;
  <FONT color="lightblue">Array slices</FONT>
   with a <FONT color="orange">list of  indexes</FONT>
  &nbsp; </SPAN>
  </B></FONT>

  </SPAN>
  </B></FONT>
  </div>

  <!------------------ Optional header ------------------>
  <p style="margin-left: 0.6in">
  <font size="+2">
  </font>
  </p>

  <!------------------ Slide ------------------>
  <center>
  <TABLE bgcolor="lightcyan" BORDER="5" width=950>
  <TR> <TD>
  <font size="+2">
  <UL>
  <LI> <B>Examples:</B>
<P>
<CENTER>
<TABLE bgcolor="lightyellow" BORDER="5" width=800>
<TR> <TD>

<FONT color="blue" size="+2">
<B>
<PRE>
s = pd.Series([1,2,3,4,5],index = ['a','b','c','d','e'])

print)s[<FONT color="red">['a','c','d']</FONT>])

<FONT color="red">Output:</FONT>
            a    4
	    c    6
	    d    7
</PRE>
</B>
</FONT>

</TD> </TR>
</TABLE>
</CENTER>
<P>
  <p style="padding: 1.0in">
  </p>

  </UL>
  </font>
  </TD> </TR>
  </TABLE>
  </center>

  <!------------------ Optional footer ------------------>
  <p style="margin-left: 0.6in">
  <font size="+2">
  <FONT color="red"><B>DEMO:</B></FONT>
  <FONT color="blue"><B><TT>progs/series05.py</TT></B></FONT>
  </font>
  </p>

  <!------------------ Spacing ------------------>
  <p style="padding: 0.0in">
  </p>
</div>







<!-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx -->

<!------------------------------------------------------------------->


<!-- The dots/circles -->
<div style="text-align:center">
  <span class="dot" onclick="currentSlide(1)"></span>
  <span class="dot" onclick="currentSlide(2)"></span>
  <span class="dot" onclick="currentSlide(3)"></span>
  <span class="dot" onclick="currentSlide(4)"></span>
  <span class="dot" onclick="currentSlide(5)"></span>
  <span class="dot" onclick="currentSlide(6)"></span>
  <span class="dot" onclick="currentSlide(7)"></span>
  <span class="dot" onclick="currentSlide(8)"></span>
  <span class="dot" onclick="currentSlide(9)"></span>

</div> 







  <!-- Next and previous buttons -->
  <a class="prev" onclick="plusSlides(-1)">
       <FONT size="+2" color="red"><B>&#10094;</B></FONT></a>
  <a class="next" onclick="plusSlides(1)">
       <FONT size="+2" color="red"><B>&#10095;</B></FONT></a>

</div>
<br>

<script>
var slideIndex = 1;
showSlides(slideIndex);

function plusSlides(n) {
  showSlides(slideIndex += n);
}

function currentSlide(n) {
  showSlides(slideIndex = n);
}

function showSlides(n) {
  var i;
  var slides = document.getElementsByClassName("mySlides");
  var dots = document.getElementsByClassName("dot");
  if (n > slides.length) {slideIndex = 1}    
  if (n < 1) {slideIndex = slides.length}
  for (i = 0; i < slides.length; i++) {
      slides[i].style.display = "none";  
  }
  for (i = 0; i < dots.length; i++) {
      dots[i].className = dots[i].className.replace(" active", "");
  }
  slides[slideIndex-1].style.display = "block";  
  dots[slideIndex-1].className += " active";
}
</script>

<P>
