Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases now! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Pandas Cookbook
Pandas Cookbook

Pandas Cookbook: Practical recipes for scientific computing, time series, and exploratory data analysis using Python , Third Edition

Arrow left icon
Profile Icon William Ayd Profile Icon Matthew Harrison
Arrow right icon
$49.99
Full star icon Full star icon Full star icon Full star icon Half star icon 4.8 (4 Ratings)
Paperback Oct 2024 404 pages 3rd Edition
eBook
$27.98 $39.99
Paperback
$49.99
Subscription
Free Trial
Renews at $19.99p/m
Arrow left icon
Profile Icon William Ayd Profile Icon Matthew Harrison
Arrow right icon
$49.99
Full star icon Full star icon Full star icon Full star icon Half star icon 4.8 (4 Ratings)
Paperback Oct 2024 404 pages 3rd Edition
eBook
$27.98 $39.99
Paperback
$49.99
Subscription
Free Trial
Renews at $19.99p/m
eBook
$27.98 $39.99
Paperback
$49.99
Subscription
Free Trial
Renews at $19.99p/m

What do you get with Print?

Product feature icon Instant access to your digital eBook copy whilst your Print order is Shipped
Product feature icon Paperback book shipped to your preferred address
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Table of content icon View table of contents Preview book icon Preview Book

Pandas Cookbook

pandas Foundations

The pandas library is useful for dealing with structured data. What is structured data? Data that is stored in tables, such as CSV files, Excel spreadsheets, or database tables, is all structured. Unstructured data consists of free-form text, images, sound, or video. If you find yourself dealing with structured data, pandas will be of great utility to you.

pd.Series is a one-dimensional collection of data. If you are coming from Excel, you can think of this as a column. The main difference is that, like a column in a database, all of the values within pd.Series must have a single, homogeneous type.

pd.DataFrame is a two-dimensional object. Much like an Excel sheet or database table can be thought of as a collection of columns, pd.DataFrame can be thought of as a collection of pd.Series objects. Each pd.Series has a homogeneous data type, but the pd.DataFrame is allowed to be heterogeneous and store a variety of pd.Series objects with different data types.

pd.Index does not have a direct analogy with other tools. Excel may offer the closest with auto-numbered rows on the left-hand side of a worksheet, but those numbers tend to be for display purposes only. pd.Index, as you will find over the course of this book, can be used for selecting values, joining tables, and much more.

The recipes in this chapter will show you how to manually construct pd.Series and pd.DataFrame objects, customize the pd.Index object(s) associated with each, and showcase common attributes of the pd.Series and pd.DataFrame that you may need to inspect during your analyses.

We are going to cover the following recipes in this chapter:

  • Importing pandas
  • Series
  • DataFrame
  • Index
  • Series attributes
  • DataFrame attributes

Importing pandas

Most users of the pandas library will use an import alias so they can refer to it as pd. In general, in this book, we will not show the pandas and NumPy imports, but they look like this:

import pandas as pd
import numpy as np

While it is an optional dependency in the 2.x series of pandas, many examples in this book will also leverage the PyArrow library, which we assume to be imported as:

import pyarrow as pa

Series

The basic building block in pandas is a pd.Series, which is a one-dimensional array of data paired with a pd.Index. The index labels can be used as a simplistic way to look up values in the pd.Series, much like the Python dictionary built into the language uses key/value pairs (we will expand on this and much more pd.Index functionality in Chapter 2, Selection and Assignment).

The following section demonstrates a few ways of creating a pd.Series directly.

How to do it

The easiest way to construct a pd.Series is to provide a sequence of values, like a list of integers:

pd.Series([0, 1, 2])
0    0
1    1
2    2
dtype: int64

A tuple is another type of sequence, making it valid as an argument to the pd.Series constructor:

pd.Series((12.34, 56.78, 91.01))
0    12.34
1    56.78
2    91.01
dtype: float64

When generating sample data, you may often reach for the Python range function:

pd.Series(range(0, 7, 2))
0    0
1    2
2    4
3    6
dtype: int64

In all of the examples so far, pandas will try and infer a proper data type from its arguments for you. However, there are times when you will know more about the type and size of your data than can be inferred. Providing that information explicitly to pandas via the dtype= argument can be useful to save memory or ensure proper integration with other typed systems, like SQL databases.

To illustrate this, let’s use a simple range argument to fill a pd.Series with a sequence of integers. When we did this before, the inferred data type was a 64-bit integer, but we, as developers, may know that we never expect to store larger values in this pd.Series and would be fine with only 8 bits of storage (if you do not know the difference between an 8-bit and 64-bit integer, that topic will be covered in Chapter 3, Data Types). Passing dtype="int8" to the pd.Series constructor will let pandas know we want to use the smaller data type:

pd.Series(range(3), dtype="int8")
0    0
1    1
2    2
dtype: int8

A pd.Series can also have a name attached to it, which can be specified via the name= argument (if not specified, the name defaults to None):

pd.Series(["apple", "banana", "orange"], name="fruit")
0     apple
1     banana
2     orange
Name: fruit, dtype: object

DataFrame

While pd.Series is the building block, pd.DataFrame is the main object that comes to mind for users of pandas. pd.DataFrame is the primary and most commonly used object in pandas, and when people think of pandas, they typically envision working with a pd.DataFrame.

In most analysis workflows, you will be importing your data from another source, but for now, we will show you how to construct a pd.DataFrame directly (input/output will be covered in Chapter 4, The pandas I/O System).

How to do it

The most basic construction of a pd.DataFrame happens with a two-dimensional sequence, like a list of lists:

pd.DataFrame([
    [0, 1, 2],
    [3, 4, 5],
    [6, 7, 8],
])
    0   1   2
0   0   1   2
1   3   4   5
2   6   7   8

With a list of lists, pandas will automatically number the row and column labels for you. Typically, users of pandas will at least provide labels for columns, as it makes indexing and selecting from a pd.DataFrame much more intuitive (see Chapter 2, Selection and Assignment, for an introduction to indexing and selecting). To label your columns when constructing a pd.DataFrame from a list of lists, you can provide a columns= argument to the constructor:

pd.DataFrame([
    [1, 2],
    [4, 8],
], columns=["col_a", "col_b"])
     col_a    col_b
0    1          2
1    4          8

Instead of using a list of lists, you could also provide a dictionary. The keys of the dictionary will be used as column labels, and the values of the dictionary will represent the values placed in that column of the pd.DataFrame:

pd.DataFrame({
    "first_name": ["Jane", "John"],
    "last_name": ["Doe", "Smith"],
})
            first_name      last_name
0           Jane            Doe
1           John            Smith

In the above example, our dictionary values were lists of strings, but the pd.DataFrame does not strictly require lists. Any sequence will work, including a pd.Series:

ser1 = pd.Series(range(3), dtype="int8", name="int8_col")
ser2 = pd.Series(range(3), dtype="int16", name="int16_col")
pd.DataFrame({ser1.name: ser1, ser2.name: ser2})
             int8_col         int16_col
0            0                0
1            1                1
2            2                2

Index

When constructing both the pd.Series and pd.DataFrame objects in the previous sections, you likely noticed the values to the left of these objects starting at 0 and incrementing by 1 for each new row of data. The object responsible for those values is the pd.Index, highlighted in the following image:

Figure 1.1: Default pd.Index, highlighted in red

In the case of a pd.DataFrame, you have a pd.Index not only to the left of the object (often referred to as the row index or even just index) but also above (often referred to as the column index or columns):

A screenshot of a computer

Figure 1.2: A pd.DataFrame with a row and column index

Unless explicitly provided, pandas will create an auto-numbered pd.Index for you (technically, this is a pd.RangeIndex, a subclass of the pd.Index class). However, it is very rare to use pd.RangeIndex for your columns, as referring to a column named City or Date is more expressive than referring to a column in the nth position. The pd.RangeIndex appears more commonly in the row index, although you may still want custom labels to appear there as well. More advanced selection operations with the default pd.RangeIndex and custom pd.Index values will be covered in Chapter 2, Selection and Assignment, to help you understand different use cases, but for now, let’s just look at how you would override the construction of the row and column pd.Index objects during pd.Series and pd.DataFrame construction.

How to do it

When constructing a pd.Series, the easiest way to change the row index is by providing a sequence of labels to the index= argument. In this example, the labels dog, cat, and human will be used instead of the default pd.RangeIndex numbered from 0 to 2:

pd.Series([4, 4, 2], index=["dog", "cat", "human"])
dog          4
cat          4
human        2
dtype: int64

If you want finer control, you may want to construct the pd.Index yourself before passing it as an argument to index=. In the following example, the pd.Index is given the name animal, and the pd.Series itself is named num_legs, providing more context to the data:

index = pd.Index(["dog", "cat", "human"], name="animal")
pd.Series([4, 4, 2], name="num_legs", index=index)
animal
dog          4
cat          4
human        2
Name: num_legs, dtype: int64

A pd.DataFrame uses a pd.Index for both dimensions. Much like with the pd.Series constructor, the index= argument can be used to specify the row labels, but you now also have the columns= argument to control the column labels:

pd.DataFrame([
    [24, 180],
    [42, 166],
], columns=["age", "height_cm"], index=["Jack", "Jill"])
         age    height_cm
Jack     24     180
Jill     42     166

Series attributes

Once you have a pd.Series, there are quite a few attributes you may want to inspect. The most basic attributes can tell you the type and size of your data, which is often the first thing you will inspect when reading in data from a data source.

How to do it

Let’s start by creating a pd.Series that has a name, alongside a custom pd.Index, which itself has a name. Although not all of these elements are required, having them will help us more clearly understand what the attributes we access through this recipe are actually showing us:

index = pd.Index(["dog", "cat", "human"], name="animal")
ser = pd.Series([4, 4, 2], name="num_legs", index=index)
ser
animal
dog      4
cat      4
human    2
Name: num_legs, dtype: int64

The first thing users typically want to know about their data is the type of pd.Series. This can be inspected via the pd.Series.dtype attribute:

ser.dtype
dtype('int64')

The name may be inspected via the pd.Series.name attribute. The data we constructed in this recipe was created with the name="num_legs" argument, which is what you will see when accessing this attribute (if not provided, this will return None):

ser.name
num_legs

The associated pd.Index can be accessed via pd.Series.index:

ser.index
Index(['dog', 'cat', 'human'], dtype='object', name='animal')

The name of the associated pd.Index can be accessed via pd.Series.index.name:

ser.index.name
animal

The shape can be accessed via pd.Series.shape. For a one-dimensional pd.Series, the shape is returned as a one-tuple where the first element represents the number of rows:

ser.shape
3

The size (number of elements) can be accessed via pd.Series.size:

ser.size
3

The Python built-in function len can show you the length (number of rows):

len(ser)
3

DataFrame attributes

The pd.DataFrame shares many of the attributes of the pd.Series, with some slight differences. Generally, pandas tries to share as many attributes as possible between the pd.Series and pd.DataFrame, but the two-dimensional nature of the pd.DataFrame makes it more natural to express some things in plural form (for example, the .dtype attribute becomes .dtypes) and gives us a few more attributes to inspect (for example, .columns exists for a pd.DataFrame but not for a pd.Series).

How to do it

Much like we did in the previous section, we are going to construct a pd.DataFrame with a custom pd.Index in the rows, while also using custom labels in the columns. This will be more helpful when inspecting the various attributes:

index = pd.Index(["Jack", "Jill"], name="person")
df = pd.DataFrame([
    [24, 180, "red"],
    [42, 166, "blue"],
], columns=["age", "height_cm", "favorite_color"], index=index)
df
           age    height_cm    favorite_color
person
Jack       24     180          red
Jill       42     166          blue

The types of each column can be inspected via the pd.DataFrame.dtypes attribute. This attribute returns a pd.Series where each row shows the data type corresponding to each column in our pd.DataFrame:

df.dtypes
age                int64
height_cm          int64
favorite_color     object
dtype: object

The row index can be accessed via pd.DataFrame.index:

df.index
Index(['Jack', 'Jill'], dtype='object', name='person')

The column index can be accessed via pd.DataFrame.columns:

df.columns
Index(['age', 'height_cm', 'favorite_color'], dtype='object')

The shape can be accessed via pd.DataFrame.shape. For a two-dimensional pd.DataFrame, the shape is returned as a two-tuple where the first element represents the number of rows and the second element represents the number of columns:

df.shape
2     3

The size (number of elements) can be accessed via pd.DataFrame.size:

df.size
6

The Python built-in function len can show you the length (number of rows):

len(df)
2

Join our community on Discord

Join our community’s Discord space for discussions with the authors and other readers:

https://packt.link/pandas

Left arrow icon Right arrow icon
Download code icon Download Code

Key benefits

  • This book targets features in pandas 2.x and beyond
  • Practical, easy to implement recipes for quick solutions to common problems in data using pandas
  • Master the fundamentals of pandas to quickly begin exploring any dataset

Description

The pandas library is massive, and it's common for frequent users to be unaware of many of its more impressive features. The official pandas documentation, while thorough, does not contain many useful examples of how to piece together multiple commands as one would do during an actual analysis. This book guides you, as if you were looking over the shoulder of an expert, through situations that you are highly likely to encounter. With this latest edition unlock the full potential of pandas 2.x onwards. Whether you're a beginner or an experienced data analyst, this book offers a wealth of practical recipes to help you excel in your data analysis projects. This cookbook covers everything from fundamental data manipulation tasks to advanced techniques for handling big data, visualization, and more. Each recipe is designed to address common real-world challenges, providing clear explanations and step-by-step instructions to guide you through the process. Explore cutting-edge topics such as idiomatic pandas coding, efficient handling of large datasets, and advanced data visualization techniques.  Whether you're looking to sharpen or expand your skills, the "Pandas Cookbook" is your essential companion for mastering data analysis and manipulation with pandas 2.x, and beyond.

Who is this book for?

This book is for Python developers, data scientists, engineers, and analysts. pandas is the ideal tool for manipulating structured data with Python and this book provides ample instruction and examples. Not only does it cover the basics required to be proficient, but it goes into the details of idiomatic pandas

What you will learn

  • The pandas type system and how to best navigate it
  • Import/export DataFrames to/from common data formats
  • Data exploration in pandas through dozens of practice problems
  • Grouping, aggregation, transformation, reshaping, and filtering data
  • Merge data from different sources through pandas SQL-like operations
  • Leverage the robust pandas time series functionality in advanced analyses
  • Scale pandas operations to get the most out of your system
  • The large ecosystem that pandas can coordinate with and supplement
Estimated delivery fee Deliver to Ecuador

Standard delivery 10 - 13 business days

$19.95

Premium delivery 3 - 6 business days

$40.95
(Includes tracking information)

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Oct 31, 2024
Length: 404 pages
Edition : 3rd
Language : English
ISBN-13 : 9781836205876
Category :
Languages :
Concepts :
Tools :

What do you get with Print?

Product feature icon Instant access to your digital eBook copy whilst your Print order is Shipped
Product feature icon Paperback book shipped to your preferred address
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Estimated delivery fee Deliver to Ecuador

Standard delivery 10 - 13 business days

$19.95

Premium delivery 3 - 6 business days

$40.95
(Includes tracking information)

Product Details

Publication date : Oct 31, 2024
Length: 404 pages
Edition : 3rd
Language : English
ISBN-13 : 9781836205876
Category :
Languages :
Concepts :
Tools :

Packt Subscriptions

See our plans and pricing
Modal Close icon
$19.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
$199.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just $5 each
Feature tick icon Exclusive print discounts
$279.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just $5 each
Feature tick icon Exclusive print discounts

Table of Contents

12 Chapters
pandas Foundations Chevron down icon Chevron up icon
Selection and Assignment Chevron down icon Chevron up icon
Data Types Chevron down icon Chevron up icon
The pandas I/O System Chevron down icon Chevron up icon
Algorithms and How to Apply Them Chevron down icon Chevron up icon
Visualization Chevron down icon Chevron up icon
Reshaping DataFrames Chevron down icon Chevron up icon
Group By Chevron down icon Chevron up icon
Temporal Data Types and Algorithms Chevron down icon Chevron up icon
General Usage and Performance Tips Chevron down icon Chevron up icon
The pandas Ecosystem Chevron down icon Chevron up icon
Index Chevron down icon Chevron up icon

Customer reviews

Rating distribution
Full star icon Full star icon Full star icon Full star icon Half star icon 4.8
(4 Ratings)
5 star 75%
4 star 25%
3 star 0%
2 star 0%
1 star 0%
Robert Nov 03, 2024
Full star icon Full star icon Full star icon Full star icon Full star icon 5
The third edition of Cooking with Pandas was a welcome resource for learning about Pandas in Python. The book starts with the foundations and continues to build throughout. Like any good cookbook, there is a quick explanation of the material and a section on how to perform the task.The book is for anyone interested in Pandas, from beginners to well-seasoned developers. You can't go wrong by picking up this book. You will learn a lot!
Amazon Verified review Amazon
Kindle Customer Nov 03, 2024
Full star icon Full star icon Full star icon Full star icon Empty star icon 4
The third edition is another winner!Very well written, lots of "recipes" to follow along with and practice. As a newbie I found it challenging but it is worth it. Excellent reference for individual problem solving. You can jump into a certain topic and learn new things.Also teaches you how to read data all the way to create visualizations for reports.Will definitely use this as a reference and recommend to colleagues.
Amazon Verified review Amazon
JW Nov 02, 2024
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Pandas Cookbook third edition is an excellent reference for pandas users. Ihave been writing Python code and using pandas for more than 10 years, andstill managed to learn something every chapter reading this book. I found it tobe written in such a way that it allowed for reading cover to cover, but wouldalso be useful jumping straight to the sections you need when trying to use asa reference.The examples in the book remained short enough for readers to use themselvesbut still clear enough to demonstrate both the "how" and "why." This book Ifound approachable enough that I would even recommend it to people just gettingintroduced to pandas. Experienced pandas will likely appreciate this bookexplains not just the "how" to accomplish a task but also the "why."Covering topics like reading data in from different sources, various ways toselect data, how to perform aggregations and transformations well, working withcomplex types (such as datetimes), performance tuning, and visualizations, thisis a book that I will find myself reaching for regularly.
Amazon Verified review Amazon
Souvik Roy Nov 02, 2024
Full star icon Full star icon Full star icon Full star icon Full star icon 5
The book is perfect for beginners as there are tons of resources online, and this book tries to bring it all up in one place. I am new to Time Series, so this book will personally help me to know more about it and make me efficient in using the knowledge in the book in my real-world projects.
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

What is the delivery time and cost of print book? Chevron down icon Chevron up icon

Shipping Details

USA:

'

Economy: Delivery to most addresses in the US within 10-15 business days

Premium: Trackable Delivery to most addresses in the US within 3-8 business days

UK:

Economy: Delivery to most addresses in the U.K. within 7-9 business days.
Shipments are not trackable

Premium: Trackable delivery to most addresses in the U.K. within 3-4 business days!
Add one extra business day for deliveries to Northern Ireland and Scottish Highlands and islands

EU:

Premium: Trackable delivery to most EU destinations within 4-9 business days.

Australia:

Economy: Can deliver to P. O. Boxes and private residences.
Trackable service with delivery to addresses in Australia only.
Delivery time ranges from 7-9 business days for VIC and 8-10 business days for Interstate metro
Delivery time is up to 15 business days for remote areas of WA, NT & QLD.

Premium: Delivery to addresses in Australia only
Trackable delivery to most P. O. Boxes and private residences in Australia within 4-5 days based on the distance to a destination following dispatch.

India:

Premium: Delivery to most Indian addresses within 5-6 business days

Rest of the World:

Premium: Countries in the American continent: Trackable delivery to most countries within 4-7 business days

Asia:

Premium: Delivery to most Asian addresses within 5-9 business days

Disclaimer:
All orders received before 5 PM U.K time would start printing from the next business day. So the estimated delivery times start from the next day as well. Orders received after 5 PM U.K time (in our internal systems) on a business day or anytime on the weekend will begin printing the second to next business day. For example, an order placed at 11 AM today will begin printing tomorrow, whereas an order placed at 9 PM tonight will begin printing the day after tomorrow.


Unfortunately, due to several restrictions, we are unable to ship to the following countries:

  1. Afghanistan
  2. American Samoa
  3. Belarus
  4. Brunei Darussalam
  5. Central African Republic
  6. The Democratic Republic of Congo
  7. Eritrea
  8. Guinea-bissau
  9. Iran
  10. Lebanon
  11. Libiya Arab Jamahriya
  12. Somalia
  13. Sudan
  14. Russian Federation
  15. Syrian Arab Republic
  16. Ukraine
  17. Venezuela
What is custom duty/charge? Chevron down icon Chevron up icon

Customs duty are charges levied on goods when they cross international borders. It is a tax that is imposed on imported goods. These duties are charged by special authorities and bodies created by local governments and are meant to protect local industries, economies, and businesses.

Do I have to pay customs charges for the print book order? Chevron down icon Chevron up icon

The orders shipped to the countries that are listed under EU27 will not bear custom charges. They are paid by Packt as part of the order.

List of EU27 countries: www.gov.uk/eu-eea:

A custom duty or localized taxes may be applicable on the shipment and would be charged by the recipient country outside of the EU27 which should be paid by the customer and these duties are not included in the shipping charges been charged on the order.

How do I know my custom duty charges? Chevron down icon Chevron up icon

The amount of duty payable varies greatly depending on the imported goods, the country of origin and several other factors like the total invoice amount or dimensions like weight, and other such criteria applicable in your country.

For example:

  • If you live in Mexico, and the declared value of your ordered items is over $ 50, for you to receive a package, you will have to pay additional import tax of 19% which will be $ 9.50 to the courier service.
  • Whereas if you live in Turkey, and the declared value of your ordered items is over € 22, for you to receive a package, you will have to pay additional import tax of 18% which will be € 3.96 to the courier service.
How can I cancel my order? Chevron down icon Chevron up icon

Cancellation Policy for Published Printed Books:

You can cancel any order within 1 hour of placing the order. Simply contact customercare@packt.com with your order details or payment transaction id. If your order has already started the shipment process, we will do our best to stop it. However, if it is already on the way to you then when you receive it, you can contact us at customercare@packt.com using the returns and refund process.

Please understand that Packt Publishing cannot provide refunds or cancel any order except for the cases described in our Return Policy (i.e. Packt Publishing agrees to replace your printed book because it arrives damaged or material defect in book), Packt Publishing will not accept returns.

What is your returns and refunds policy? Chevron down icon Chevron up icon

Return Policy:

We want you to be happy with your purchase from Packtpub.com. We will not hassle you with returning print books to us. If the print book you receive from us is incorrect, damaged, doesn't work or is unacceptably late, please contact Customer Relations Team on customercare@packt.com with the order number and issue details as explained below:

  1. If you ordered (eBook, Video or Print Book) incorrectly or accidentally, please contact Customer Relations Team on customercare@packt.com within one hour of placing the order and we will replace/refund you the item cost.
  2. Sadly, if your eBook or Video file is faulty or a fault occurs during the eBook or Video being made available to you, i.e. during download then you should contact Customer Relations Team within 14 days of purchase on customercare@packt.com who will be able to resolve this issue for you.
  3. You will have a choice of replacement or refund of the problem items.(damaged, defective or incorrect)
  4. Once Customer Care Team confirms that you will be refunded, you should receive the refund within 10 to 12 working days.
  5. If you are only requesting a refund of one book from a multiple order, then we will refund you the appropriate single item.
  6. Where the items were shipped under a free shipping offer, there will be no shipping costs to refund.

On the off chance your printed book arrives damaged, with book material defect, contact our Customer Relation Team on customercare@packt.com within 14 days of receipt of the book with appropriate evidence of damage and we will work with you to secure a replacement copy, if necessary. Please note that each printed book you order from us is individually made by Packt's professional book-printing partner which is on a print-on-demand basis.

What tax is charged? Chevron down icon Chevron up icon

Currently, no tax is charged on the purchase of any print book (subject to change based on the laws and regulations). A localized VAT fee is charged only to our European and UK customers on eBooks, Video and subscriptions that they buy. GST is charged to Indian customers for eBooks and video purchases.

What payment methods can I use? Chevron down icon Chevron up icon

You can pay with the following card types:

  1. Visa Debit
  2. Visa Credit
  3. MasterCard
  4. PayPal
What is the delivery time and cost of print books? Chevron down icon Chevron up icon

Shipping Details

USA:

'

Economy: Delivery to most addresses in the US within 10-15 business days

Premium: Trackable Delivery to most addresses in the US within 3-8 business days

UK:

Economy: Delivery to most addresses in the U.K. within 7-9 business days.
Shipments are not trackable

Premium: Trackable delivery to most addresses in the U.K. within 3-4 business days!
Add one extra business day for deliveries to Northern Ireland and Scottish Highlands and islands

EU:

Premium: Trackable delivery to most EU destinations within 4-9 business days.

Australia:

Economy: Can deliver to P. O. Boxes and private residences.
Trackable service with delivery to addresses in Australia only.
Delivery time ranges from 7-9 business days for VIC and 8-10 business days for Interstate metro
Delivery time is up to 15 business days for remote areas of WA, NT & QLD.

Premium: Delivery to addresses in Australia only
Trackable delivery to most P. O. Boxes and private residences in Australia within 4-5 days based on the distance to a destination following dispatch.

India:

Premium: Delivery to most Indian addresses within 5-6 business days

Rest of the World:

Premium: Countries in the American continent: Trackable delivery to most countries within 4-7 business days

Asia:

Premium: Delivery to most Asian addresses within 5-9 business days

Disclaimer:
All orders received before 5 PM U.K time would start printing from the next business day. So the estimated delivery times start from the next day as well. Orders received after 5 PM U.K time (in our internal systems) on a business day or anytime on the weekend will begin printing the second to next business day. For example, an order placed at 11 AM today will begin printing tomorrow, whereas an order placed at 9 PM tonight will begin printing the day after tomorrow.


Unfortunately, due to several restrictions, we are unable to ship to the following countries:

  1. Afghanistan
  2. American Samoa
  3. Belarus
  4. Brunei Darussalam
  5. Central African Republic
  6. The Democratic Republic of Congo
  7. Eritrea
  8. Guinea-bissau
  9. Iran
  10. Lebanon
  11. Libiya Arab Jamahriya
  12. Somalia
  13. Sudan
  14. Russian Federation
  15. Syrian Arab Republic
  16. Ukraine
  17. Venezuela