From 867aeed209630ca00861ff1b409e964c36dc02a9 Mon Sep 17 00:00:00 2001 From: Rajat Date: Tue, 18 Dec 2018 09:10:30 +0530 Subject: [PATCH] added example of using pandas.series (#30534) --- .../english/data-science-tools/pandas/index.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/guide/english/data-science-tools/pandas/index.md b/guide/english/data-science-tools/pandas/index.md index f9642ee263..67cd0762f8 100644 --- a/guide/english/data-science-tools/pandas/index.md +++ b/guide/english/data-science-tools/pandas/index.md @@ -29,6 +29,24 @@ A data frame consists of a number of rows and columns. Each column represents a ## Series Series is the basic data-type in pandas. A Series is very similar to an array (NumPy array) (in fact it is built on top of the NumPy array object). A Series can have axis labels, as it can be indexed by a label with no number indexing for the location of data. It can hold any valid Python Object like List, Dictionary, etc. +```python +pd.Series([1,2,3]) +``` +output: +```output +0 1 +1 2 +2 3 +dtype: int64 +``` +```python +np.array([1,2,3]) +``` +output: +```output +array([1, 2, 3]) +``` + ## Loading Data from a CSV File A `.csv` file is a *comma separated value* file. A very common way to store data. To load such data into a pandas data frame use the `read_csv` method: ```python