A guide to help implement various Pandas functions on stock data.

When dealing with time-series data, it has a different format and usually has a DateTime index and its corresponding value. Some examples of time-series data can be stock market data, count of sunspots, or temperature reading of the atmosphere.

In this article, I will take you through the different Pandas methods that can be used with time-series stock data.

When dealing with time-series data, date and time information is a must and is always given. But the date and time information is not always in columns separated. There is a possibility that it is actually the index of a dataset (datetime index). …

A guide to understanding how to procure data for doing financial analysis using Python.

When you plan to work on using Python for finance, a particular form of data is needed. This data should be concerned with financial values. In this article, I will introduce two methods to get financial data using the Python language.

The first method that I have mentioned deals with getting data using Pandas-datareader. Pandas is an open-source Python library that is used for performing data analysis and is used as a manipulation tool. Check out this article mentioned below to know about Pandas in detail.

So the subpackage Pandas-datareader helps the user to create dataframes from the internet sources available. It allows one to connect to many sources like Yahoo Finance, World Bank, Google Analytics, St.Louis FED (FRED) and Kenneth French’s data library. …

Time series data is a sequence of data points that are indexed in time order. These data points are measured at different points of time and are used to track change over a period of time.

In this article, I will take you through the different Pandas functions to visualize time series data.

To know about Pandas basic functions, check out my articles here and here.

The necessary packages to perform the visualizations are imported.

**>>> import** pandas **as** pd

**>>> import** matplotlib.pyplot **as** plt

**>>> %**matplotlib inline

The time-series data used is McDonalds data. It has 3 columns: Date, adjusted close and adjusted volume. We will name the rows according to the date and have the other 2 as columns. …

Geographical plotting is used for world maps and also for different states of the countries. It is useful when map-based data has to be analyzed and draw insights. An application area of this is for visualization export and import data of goods.

Plotly will be used for plotting. The reason being that it creates interactive plots.

To know about Plotly in detail, check my article here.

The plotly package is imported. Along with this few modules from plotly offline are also imported since we are using in the offline mode. The Pandas package is imported for dealing with dataframes.

**>>> import** pandas **as** pd

**>>> import** plotly **as** py

**>>> from** plotly.offline **import…**

Plotly is a library that is used for creating interactive visualizations o the data. Cufflinks, on the other hand, helps to connect Plotly with Pandas library.

To know more about Pandas, check my article here.

pip install plotly

pip install cufflinks

The basic packages like numpy and pandas will be imported along with plotly and cufflinks. We will also import few packages of the plotly offline since we are doing it in the offline mode.

**>>> import** pandas **as** pd

**>>> import** numpy **as** np

**>>> import** plotly

**>>> import** cufflinks **as** cf

**>>> from** plotly.offline **import **download_plotlyjs,init_notebook_mode,plot,iplot

To make sure that the plots are created inside the notebook, write the below code. …

Numpy and Pandas package is imported. Along with this the magic function ‘%matplotlib inline’ is mentioned to make sure that the plots are displayed in the notebook.

**>>> import** numpy **as** np

**>>> import** pandas **as** pd

**>>> %**matplotlib inline

For the purpose of understanding, a dataset is taken which has random values.

`>>> df1 `**=** pd.read_csv('dataset2.csv')

>>> df1.head()

A histogram plot can be generated by using the method ‘hist’ on a column of a dataframe. The number of bins can also be specified.

`>>> df1['b'].hist(bins`**=**15)

Seaborn is a library that is used for statistical plotting. This library is built on top of Matplotlib. It has many default styling options and also works well with Pandas.

*To know more about Matplotlib, kindly check my article **here**.*

To install using pip:`pip install seaborn`

To install using Anaconda:`conda install seaborn`

Seaborn is imported and along with it the magic function is mentioned below it to make sure that the plots generated are inline and displayed in the notebook.

**>>> import** seaborn **as** sns

**>>> %**matplotlib inline

Seaborn has inbuilt datasets which can be used. So the ‘tips’ dataset will be used here. This dataset has information of how much tip is given on the total bill. …

Matplotlib is a very well known and widely used library for Python. It helps in the visualization of the data which is analyzed using Numpy and Pandas. It is a very useful library for generating 2D and 3D figures.

To know about Numpy and Pandas, refer to my articles here and here respectively.

To install using pip:

pip install matplotlib

To install using Anaconda:

conda install matplotlib

**>>> import** matplotlib.pyplot **as** plt

If using jupyter notebooks, then the below line is useful to display the figure inside the jupyter notebook. Incase not using notebooks, then after the code, you have to mention plt.show() …

Pandas is an open-source library that is used for data processing tasks like cleaning and preparation. It paves way for fast analysis of data and also has techniques for visualizing the data. It is built on top of the NumPy library.

To know more about the NumPy library, check my article here.

- Through command line using pip

pip install pandas

2. Through command line using Anaconda

conda install pandas

Series is in resemblance to a NumPy array but the difference is that series can be accessed by labels or it can be indexed by labels. …

NumPy is a library of Python that will help in analyzing the data. It is used by individuals who deal with data science. It is a linear algebra library that has bindings to C libraries making it really fast.

To install NumPy using pip:

pip install numpy

To install Numpy using Anaconda:

conda install numpy

While working with NumPy for data science, mostly we have to deal with NumPy arrays. These arrays are of two types:

- Matrices

Matrices are usually two-dimensional but they can still have either only one row or one column.

2. Vectors

Vectors on the other hand are strictly one-dimensional. …

About