Search icon CANCEL
Subscription
0
Cart icon
Cart
Close icon
You have no products in your basket yet
Save more on your purchases!
Savings automatically calculated. No voucher code required
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Learning Predictive Analytics with Python

You're reading from  Learning Predictive Analytics with Python

Product type Book
Published in Feb 2016
Publisher
ISBN-13 9781783983261
Pages 354 pages
Edition 1st Edition
Languages
Authors (2):
Ashish Kumar Ashish Kumar
Profile icon Ashish Kumar
Gary Dougan Gary Dougan
Profile icon Gary Dougan
View More author details
Toc

Table of Contents (19) Chapters close

Learning Predictive Analytics with Python
Credits
Foreword
About the Author
Acknowledgments
About the Reviewer
www.PacktPub.com
Preface
1. Getting Started with Predictive Modelling 2. Data Cleaning 3. Data Wrangling 4. Statistical Concepts for Predictive Modelling 5. Linear Regression with Python 6. Logistic Regression with Python 7. Clustering with Python 8. Trees and Random Forests with Python 9. Best Practices for Predictive Modelling A List of Links
Index

Concatenating and appending data


All the required information to build a model doesn't always come from a single table or data source. In many cases, two datasets need to be joined/merged to get more information (read new column/variable). Sometimes, small datasets need to be appended together to make a big dataset which contains the complete picture. Thus, merging and appending are important components of an analyst's armor.

Let's learn each of these methods one by one. For illustrating these methods, we will be using a lot of new interesting datasets. The one we are going to use first is a dataset about the mineral contents of wine; we will have separate datasets for red and white wine. Each sample represents a different sample of red or white wine.

Let us import this dataset and have a look at it. The delimiter for this dataset is ; (a semi-colon), which needs to be taken care of:

import pandas as pd
data1=pd.read_csv('E:/Personal/Learning/Predictive Modeling Book/Book Datasets/Merge and...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at ₹800/month. Cancel anytime}