Importing data from different sources

The most basic imports which we use in day to day basis for data wrangling are described here. For more you could refer python documentation .

Import CSV ( Comma delimited file ) File

code for importing data from csv file

If the CSV have different separator, use sep or delimiter parameter to define the separator. For more check this (Source).

Import Excel File

code for importing data from excel file

If required, you could define sheet name using sheet_name parameter and you could add different engines to read different excel extensions

  • “xlrd” supports old-style Excel files (.xls)
  • “openpyxl” supports newer Excel file formats
  • “odf” supports OpenDocument file formats (.odf, .ods, .odt)
  • “pyxlsb” supports Binary Excel files

For more check this (Source).

Import JSON (JavaScript Object Notation ) File

Code for importing data from json file

For more check this (Source)

Import Parquet File

Code for importing data from parquet file

For more check this (Source)

Import multiple file of same or different formats

Code for using glob to perform operations on multiple files

For more check this (Source)

Thanks for reading!

--

--

Smriti Changulani
Python Data Wrangling by Smriti Changulani

Past — Software Engineer. Present — Data Analyst. Future — Data Scientist