MACHINE LEARNING RECIPES
DATA CLEANING PYTHON
DATA MUNGING
PANDAS CHEATSHEET
ALL TAGS
# How to convert time zone from one time series to another in pandas?

# How to convert time zone from one time series to another in pandas?

This recipe helps you convert time zone from one time series to another in pandas

Suppose we are interested in converting DatetimeIndex from one time zone to another. Pandas has everything packed up for you.

So this recipe is a short example on How to convert time zone from one time series to another in pandas. Let's get started.

```
import pandas as pd
```

Let's pause and look at these imports. Pandas is generally used for performing mathematical operation and preferably over arrays.

```
df = pd.date_range(start='2020-01-01 09:00',
freq='H', periods=3, tz='Asia/Kolkata')
print(df)
```

Here we have created a simple dataframe with some random values and time zone to Asia/Kolkata.

Now our dataset is ready.

```
print(df.tz_convert('US/Central'))
```

Using tz_covert, we have coverted time zone to US/Central.

Once we run the above code snippet, we will see:

Scroll down the ipython to visualize the results.

Difference in time zones is quite visible.

In this machine learning pricing project, we implement a retail price optimization algorithm using regression trees. This is one of the first steps to building a dynamic pricing model.

In this machine learning project, you will use the video clip of an IPL match played between CSK and RCB to forecast key performance indicators like the number of appearances of a brand logo, the frames, and the shortest and longest area percentage in the video.

In this Deep Learning Project on Image Segmentation Python, you will learn how to implement the Mask R-CNN model for early fire detection.

Machine Learning Project in R- Predict the customer churn of telecom sector and find out the key drivers that lead to churn. Learn how the logistic regression model using R can be used to identify the customer churn in telecom dataset.

In this machine learning project you will work on creating a robust prediction model of Rossmann's daily sales using store, promotion, and competitor data.

In this data science project, you will contextualize customer data and predict the likelihood a customer will stay at 100 different hotel groups.

In this deep learning project, you will build your own face recognition system in Python using OpenCV and FaceNet by extracting features from an image of a person's face.

The goal of this data science project is to build a predictive model and find out the sales of each product at a given Big Mart store.

In this time series project, you will forecast Walmart sales over time using the powerful, fast, and flexible time series forecasting library Greykite that helps automate time series problems.

In this R data science project, we will explore wine dataset to assess red wine quality. The objective of this data science project is to explore which chemical properties will influence the quality of red wines.