0

I have fetched some data from an API using pandas. That is JSON format. I want to transfer this data to a sqlite database called "pitch.db" so I can run some SQL queries on it.

This is what I have so far:

import pandas as pd
import requests
import sqlite3
import json

url = "https://baseballsavant.mlb.com/gf?game_pk=635886"
df = pd.read_json(url, orient='index')
# print(df) # This prints the data and is working
conn = sqlite3.connect('pitch.db')
c = conn.cursor()

Please tell me how can I do so?

2

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.