Importing data from various sources (CSV, Excel, SQL)
LipikaSharmaShrivast
126 views
15 slides
Aug 28, 2024
Slide 1 of 15
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
About This Presentation
Module 4: Data Collection and Cleaning with Python
Size: 2.96 MB
Language: en
Added: Aug 28, 2024
Slides: 15 pages
Slide Content
Data Collection and Cleaning with Python
Replay Module 3 Introduction to Python for Data Science Python programming Concepts (Functions, classes and Oops concept) Introduction to Jupyter Notebooks and Anaconda Basic data manipulation with pandas
Session 10: Importing data from various sources Agenda Introduction to Data Importing Overview of CSV Format and Importing CSV Data (Python Example) Overview of Excel Format and Importing Excel Data (Python Example) Overview of SQL Databases and Importing SQL Data (Python Example) Combining Data from Multiple Sources and Storing Imported Data Exporting the files in the destination.
Introduction to Data Importing The process of loading data from different external sources into a software environment.
Overview of CSV Format Comma-Separated Values, a simple file format used to store tabular data. Rows of data with fields separated by commas.
Importing CSV Data (Python Example) import pandas as pd df = pd.read_csv ('data.csv') print( df.head ())
Overview of Excel Format Microsoft Excel enables users to format, organize and calculate data in a spreadsheet . By organizing data using software like Excel, data analysts and other users can make information easier to view as data is added or changed. Excel contains a large number of boxes called cells that are ordered in rows and columns. Microsoft Excel file formats (XLS, XLSX) used for spreadsheets. Features: Supports multiple sheets, rich formatting, formulas.
Overview of SQL Databases Definition: Structured Query Language databases like MySQL, PostgreSQL, SQLite. Features: Supports complex queries, relationships, transactions. Example: Employees database with tables for departments, salaries, etc.
Importing SQL Data (Python Example) from sqlalchemy import create_engine engine = create_engine (' mysql :// username:password@localhost / dbname ') df = pd.read_sql ('SELECT * FROM employees', engine) print( df.head ())