{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"
\n",
"\n",
"# Pandas 101 - Series & DataFrames\n",
"\n",
"Get to know the basic operations on series and dataframes.\n",
"\n",
"For more details check the [User Guide](https://pandas.pydata.org/docs/user_guide/index.html) or the [API reference](https://pandas.pydata.org/docs/reference/index.html) from https://pandas.pydata.org\n",
"\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"import pandas as pd"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"***\n",
"# Series\n",
"\n",
"\n",
"### Creation\n",
"\n",
"A `Series` object can be created by `pd.Series()` with a list of values as parameter. You can get the values by the `values` attribute of the `Series`, and the index values by the `index.values` attribute. An index can be a number o a string and it can be passed by the named parameter `index` of the `pd.Series()` method."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"series1 = pd.Series([1,2,3,4])\n",
"print(\"series1 values: \" + str(series1.values))\n",
"print(\"series1 indexes: \" + str(series1.index.values))\n",
"\n",
"series2 = pd.Series([1,2,3,4], index = ['a', 'b', 'c', 'd'])\n",
"print(\"series2 values: \" + str(series2.values))\n",
"print(\"series2 indexes: \" + str(series2.index.values))"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"***\n",
"\n",
"