SajjadRobin

Learn every day

  • Like on facebookLike on facebook
  • Follow me on TwitterFollow me on Twitter
  • Subscribe to youtube channelSubscribe to youtube channel
  • Add SajjadRobin in your circleAdd SajjadRobin in your circle
  • LinkedInLinkedIn
  • FeedFeed

Category: Python

How To · Python

0

ETL in Python – read csv, json files

  • August 6, 2021

Let’s start with how to read csv, json files:

Read CSV, JSON files in Python
Python
1
2
3
4
5
6
 
import glob
list_csv = glob("*.csv")
 
list_json = glob("*.json")
 

Let’s create a function to read a CSV file in python:

Extract content from CSV in Python
Python
1
2
3
4
5
6
7
 
def extract_from_csv(file_to_process):
  dataframe = pd.read_csv(file_to_process)
  return dataframe
 
df = extract_from_csv("example1.csv")
 

Now, let’s create another function to read content[…]

Share this:

  • Tweet
  • Email

Read more

  • Get your dream job

    Learn web development
  • Go social, go viral

  • Like on Facebook

    Like on Facebook
  • Recent Posts

    • ETL in Python – read csv, json files
    • Javascript – The Good Parts: Object
    • Javascript – The Good Parts : Grammar
    • How to delete duplicate rows from a table
    • How to setup virtual host in xampp
  • Categories

    • apache
    • How To
    • Javascript
    • MySql
    • MySql
    • php
    • Python
    • security
    • Udemy
    • Web Development in Bengali
    • Wordpress website
  • Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their use.
    To find out more, including how to control cookies, see here: Cookie Policy
  • Like on facebookLike on facebook
  • Follow me on TwitterFollow me on Twitter
  • Subscribe to youtube channelSubscribe to youtube channel
  • Add SajjadRobin in your circleAdd SajjadRobin in your circle
  • LinkedInLinkedIn
  • FeedFeed

© Copyright 2018 sajjadrobin.