filmov
tv
Query pandas dataframes!! #python #sql #datascience #pandas #dataanalytics #pythonprogramming

Показать описание
In this Short, I demonstrate how to "query" dataframes with Python using the pandas .loc property.
Source code:
# Libraries
import pandas as pd
import sqlalchemy
from sqlalchemy import create_engine
# Creating SQL Alchemy engine object
# Initiailizing connection to database
sql = 'SELECT * FROM players'
# creating a dataframe
# creating a dataframe where country equals 'us'
# updating the dataframe to encompass countries that contain 'us'
Source code:
# Libraries
import pandas as pd
import sqlalchemy
from sqlalchemy import create_engine
# Creating SQL Alchemy engine object
# Initiailizing connection to database
sql = 'SELECT * FROM players'
# creating a dataframe
# creating a dataframe where country equals 'us'
# updating the dataframe to encompass countries that contain 'us'