Book Image

Learning Pandas

By : Michael Heydt
Book Image

Learning Pandas

By: Michael Heydt

Overview of this book

Table of Contents (19 chapters)
Learning pandas
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Normalizing timestamps using time zones


Time zone management can be one of the most complicated issues to deal with when working with time-series data. Data is often collected in different systems across the globe using local time, and at some point, it will require coordination with data collected in other time zones.

Fortunately, pandas provides rich support for working with timestamps in different time zones. Under the covers, pandas utilizes the pytz and dateutil libraries to manage the time zone operations. The dateutil support is new as of pandas 0.14.1 and currently only supported for fixed offset and tzfile zones. The default library used by pandas is pytz, with support for dateutil provided for compatibility with other applications.

pandas objects that are time zone-aware support a .tz property. By default, pandas objects that are time zone-aware do not utilize a timezone object for purposes of efficiency. The following gets the current time and demonstrates that there is no time...