09.10.2023 Views

Advanced Data Analytics Using Python_ With Machine Learning, Deep Learning and NLP Examples ( 2023)

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

CHAPTER 2

ETL with Python

(Structured Data)

Every data science professional has to extract, transform, and load (ETL)

data from different data sources. In this chapter, I will discuss how to do

ETL with Python for a selection of popular databases. For a relational

database, I’ll cover MySQL. As an example of a document database, I will

cover Elasticsearch. For a graph database, I’ll cover Neo4j, and for NoSQL,

I’ll cover MongoDB. I will also discuss the Pandas framework, which was

inspired by R’s data frame concept.

MySQL

MySQLdb is an API in Python developed at the top of the MySQL C interface.

How to Install MySQLdb?

First you need to install the Python MySQLdb module on your machine.

Then run the following script:

#!/usr/bin/python

import MySQLdb

© Sayan Mukhopadhyay 2018

S. Mukhopadhyay, Advanced Data Analytics Using Python,

https://doi.org/10.1007/978-1-4842-3450-1_2

23

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!