Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Jupyter Cookbook

You're reading from  Jupyter Cookbook

Product type Book
Published in Apr 2018
Publisher Packt
ISBN-13 9781788839440
Pages 238 pages
Edition 1st Edition
Languages
Author (1):
Dan Toomey Dan Toomey
Profile icon Dan Toomey

Table of Contents (17) Chapters

Title Page
Copyright and Credits
Packt Upsell
Contributors
Preface
Installation and Setting up the Environment Adding an Engine Accessing and Retrieving Data Visualizing Your Analytics Working with Widgets Jupyter Dashboards Sharing Your Code Multiuser Jupyter Interacting with Big Data Jupyter Security Jupyter Labs Index

Accessing a database


Much information is available over the internet, but some of the more sensitive or private information is available in corporate and government databases only. Fortunately, many of the languages in Jupyter provide mechanisms to access data from a database.

For this example, we will be using R for scripting. R has a database connection library, dbplyr, that can be used to access some of the more common databases. As with the file loads elsewhere in this chapter, the result of a database read would be a DataFrame. Once there, you can operate on the DataFrame like any other.

Some of the other Jupyter languages have database support through a library as well. In particular, Python and Scala have database access. In general, they work in the same manner:

  1. Make a connection to the database
  2. Run a query on the database that returns a result set
  3. The library converts the result set into a usable data type for the language

Note: some libraries allow you to work as much as possible on...

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 $15.99/month. Cancel anytime}