O'Reilly logo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Hands-On Data Analysis with NumPy and pandas

Book Description

Get to grips with the most popular Python packages that make data analysis possible

About This Book
  • Explore the tools you need to become a data analyst
  • Discover practical examples to help you grasp data processing concepts
  • Walk through hierarchical indexing and grouping for data analysis
Who This Book Is For

Hands-On Data Analysis with NumPy and Pandas is for you if you are a Python developer and want to take your first steps into the world of data analysis. No previous experience of data analysis is required to enjoy this book.

What You Will Learn
  • Understand how to install and manage Anaconda
  • Read, sort, and map data using NumPy and pandas
  • Find out how to create and slice data arrays using NumPy
  • Discover how to subset your DataFrames using pandas
  • Handle missing data in a pandas DataFrame
  • Explore hierarchical indexing and plotting with pandas
In Detail

Python, a multi-paradigm programming language, has become the language of choice for data scientists for visualization, data analysis, and machine learning.

Hands-On Data Analysis with NumPy and Pandas starts by guiding you in setting up the right environment for data analysis with Python, along with helping you install the correct Python distribution. In addition to this, you will work with the Jupyter notebook and set up a database. Once you have covered Jupyter, you will dig deep into Python's NumPy package, a powerful extension with advanced mathematical functions. You will then move on to creating NumPy arrays and employing different array methods and functions. You will explore Python's pandas extension which will help you get to grips with data mining and learn to subset your data. Last but not the least you will grasp how to manage your datasets by sorting and ranking them.

By the end of this book, you will have learned to index and group your data for sophisticated data analysis and manipulation.

Style and approach

A step-by-step approach, taking you through the different concepts and features of Data Analysis using Python libraries and tools.

Downloading the example code for this book You can download the example code files for all Packt books you have purchased from your account at http://www.PacktPub.com. If you purchased this book elsewhere, you can visit http://www.PacktPub.com/support and register to have the files e-mailed directly to you.

Table of Contents

  1. Title Page
  2. Copyright and Credits
    1. Hands-On Data Analysis with NumPy and pandas
  3. Packt Upsell
    1. Why subscribe?
    2. PacktPub.com
  4. Contributors
    1. About the author
    2. Packt is searching for authors like you
  5. Preface
    1. Who this book is for
    2. What this book covers
    3. To get the most out of this book
      1. Download the example code files
      2. Conventions used
    4. Get in touch
      1. Reviews
  6. Setting Up a Python Data Analysis Environment
    1. What is Anaconda?
    2. Installing Anaconda
    3. Exploring Jupyter Notebooks
    4. Exploring alternatives to Jupyter
      1. Spyder
      2. Rodeo
      3. ptpython
    5. Package management with Conda
      1. What is Conda?
      2. Conda environment management
      3. Managing Python
      4. Package management
    6. Setting up a database
      1. Installing MySQL
      2. MySQL connectors
      3. Creating a database
    7. Summary
  7. Diving into NumPY
    1. NumPy arrays
    2. Special numeric values
    3. Creating NumPy arrays
      1. Creating ndarray
    4. Summary
  8. Operations on NumPy Arrays
    1. Selecting elements explicitly
      1. Slicing arrays with colons
    2. Advanced indexing
    3. Expanding arrays
    4. Arithmetic and linear algebra with arrays
      1. Arithmetic with two equal-shaped arrays
      2. Broadcasting
    5. Linear algebra
    6. Employing array methods and functions
      1. Array methods
      2. Vectorization with ufuncs
        1. Custom ufuncs
    7. Summary
  9. pandas are Fun! What is pandas?
    1. What does pandas do?
    2. Exploring series and DataFrame objects
      1. Creating series
      2. Creating DataFrames
      3. Adding data
      4. Saving DataFrames
    3. Subsetting your data
      1. Subsetting a series
    4. Indexing methods
      1. Slicing a DataFrame
    5. Summary
  10. Arithmetic, Function Application, and Mapping with pandas
    1. Arithmetic
      1. Arithmetic with DataFrames
      2. Vectorization with DataFrames
      3. DataFrame function application
    2. Handling missing data in a pandas DataFrame
      1. Deleting missing information
      2. Filling missing information
    3. Summary
  11. Managing, Indexing, and Plotting
    1. Index sorting
      1. Sorting by values
    2. Hierarchical indexing
      1. Slicing a series with a hierarchical index
    3. Plotting with pandas
      1. Plotting methods
    4. Summary
  12. Other Books You May Enjoy
    1. Leave a review - let other readers know what you think