{"id":244952,"date":"2025-05-17T08:26:41","date_gmt":"2025-05-17T08:26:41","guid":{"rendered":"https:\/\/peraltafinancing.com\/analytics\/how-to-use-python-pandas-and-sql-together-for-data-analysis\/"},"modified":"2025-05-17T08:26:41","modified_gmt":"2025-05-17T08:26:41","slug":"how-to-use-python-pandas-and-sql-together-for-data-analysis","status":"publish","type":"post","link":"https:\/\/fivemor.com\/?p=244952","title":{"rendered":"How to Use Python Pandas and SQL Together for Data Analysis"},"content":{"rendered":"<p> <br \/>\n<\/p>\n<div id=\"article-start\">\n<p>For all the tasks related to data science and machine learning, the most important thing that defines how a model will perform depends on how good our data is. Python Pandas and SQL are among the powerful tools that can help in extracting and manipulating data efficiently. By combining these two together, data analysts can perform complex analysis on even large datasets. In this article, we\u2019ll explore how you can combine <a href=\"https:\/\/www.analyticsvidhya.com\/blog\/2021\/03\/pandas-functions-for-data-analysis-and-manipulation\/\" target=\"_blank\" rel=\"noreferrer noopener\">Python Pandas<\/a> with <a href=\"https:\/\/www.analyticsvidhya.com\/blog\/2022\/01\/learning-sql-from-basics-to-advance\/\" target=\"_blank\" rel=\"noreferrer noopener\">SQL<\/a> to enhance the quality of data analysis.<\/p>\n<h2 class=\"wp-block-heading\" id=\"h-pandas-and-sql-overview\">Pandas and SQL: Overview<\/h2>\n<p>Before using Pandas and SQL together. First, we\u2019ll go through Pandas and SQL is capable of and their key features.<\/p>\n<h3 class=\"wp-block-heading\" id=\"h-what-is-pandas\">What is Pandas?<\/h3>\n<p>Pandas is a software library written for Python programming language for data manipulation and analysis. It offers operations for manipulating tables, data structures, and time series data.<\/p>\n<h4 class=\"wp-block-heading\" id=\"h-key-features-of-pandas\">Key Features of Pandas<\/h4>\n<ul class=\"wp-block-list\">\n<li>Pandas DataFrames allow us to work with structured data.\u00a0<\/li>\n<li>It offers different functionalities like sorting, grouping, merging, reshaping, and filtering data.<\/li>\n<li>It is efficient in handling missing data values.<\/li>\n<\/ul>\n<p><em>Learn More: <a href=\"https:\/\/www.analyticsvidhya.com\/blog\/2022\/08\/the-ultimate-guide-to-pandas-for-data-science\/\" target=\"_blank\" rel=\"noreferrer noopener\">The Ultimate Guide to Pandas For Data Science!<\/a><\/em><\/p>\n<h3 class=\"wp-block-heading\" id=\"h-what-is-sql\">What is SQL?<\/h3>\n<p>SQL stands for Structured Query Language, which is used for extracting, managing, and manipulating relational databases. It is useful in handling structured data by incorporating relations among entities and variables. It allows for inserting, updating, deleting, and managing the stored data in tables.\u00a0<\/p>\n<h4 class=\"wp-block-heading\" id=\"h-key-features-of-sql\">Key Features of SQL<\/h4>\n<ul class=\"wp-block-list\">\n<li>It provides a robust way for querying large datasets.<\/li>\n<li>It allows the creation, modification, and deletion of database schemas.<\/li>\n<li>The syntax of SQL is optimized for efficient and complex query operations like JOIN, GROUPBY, ORDER BY, HAVING, using sub-queries.<\/li>\n<\/ul>\n<p><em>Learn More: <a href=\"https:\/\/www.analyticsvidhya.com\/blog\/2021\/06\/sql-for-data-science-a-beginners-guide\/\" target=\"_blank\" rel=\"noreferrer noopener\">SQL For Data Science: A Beginner\u2019s Guide!<\/a><\/em><\/p>\n<h3 class=\"wp-block-heading\" id=\"h-why-combine-pandas-with-sql\">Why Combine Pandas with SQL?<\/h3>\n<p>Using Pandas and SQL together makes the code more readable and, in certain cases, easier to implement. This is true for complex workflows, as SQL queries are much clearer and easier to read than the equivalent Pandas code. Moreover, most of the relational data originates from databases, and SQL is one of the main tools to deal with relational data. This is one of the main reasons why working professionals like data analysts and data scientists prefer to integrate their functionalities.<\/p>\n<h2 class=\"wp-block-heading\" id=\"h-how-does-pandasql-work\">How Does pandasql Work?<\/h2>\n<p>To combine SQL queries with Pandas, one needs a common bridge between these two, so to overcome this problem, \u2018<strong><em>pandasql<\/em><\/strong>\u2019 comes into the picture. Pandasql allows you to run SQL queries directly within Pandas. In this way, we can seamlessly use the SQL syntax without leaving the dynamic Pandas environment.<\/p>\n<h3 class=\"wp-block-heading\" id=\"h-installing-pandasql\">Installing pandasql<\/h3>\n<p>The first step to using Pandas and SQL together is to install pandasql into our environment.<\/p>\n<pre class=\"wp-block-code\"><code>pip install pandasql<\/code><\/pre>\n<figure class=\"wp-block-image size-full\"><img fetchpriority=\"high\" decoding=\"async\" width=\"872\" height=\"409\" src=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/img_1-1.webp\" alt=\"pandasql for Data Analysis\" class=\"wp-image-235138\" srcset=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/img_1-1.webp 872w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/img_1-1-300x141.webp 300w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/img_1-1-768x360.webp 768w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/img_1-1-150x70.webp 150w\" sizes=\"(max-width: 872px) 100vw, 872px\"\/><\/figure>\n<p>Once the installation is complete, we can import the pandasql into our code and use it to execute the SQL queries on Pandas DataFrame.<\/p>\n<h3 class=\"wp-block-heading\" id=\"h-running-sql-queries-in-pandas\">Running SQL Queries in Pandas<\/h3>\n<p>Once the installation is over, we can import the pandasql and start exploring it.<\/p>\n<pre class=\"wp-block-code\"><code>import pandas as pd\nimport pandasql as psql\n\n# Create a sample DataFrame\ndata = {'Name': ['Alice', 'Bob', 'Charlie'], 'Age': [25, 30, 35]}\ndf = pd.DataFrame(data)\n\n# SQL query to select all data\nquery = \"SELECT * FROM df\"\nresult = psql.sqldf(query, locals())\nresult<\/code><\/pre>\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"872\" height=\"522\" src=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/img_2-1.webp\" alt=\"pandasql for Data Analysis\" class=\"wp-image-235139\" style=\"width:310px;height:auto\" srcset=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/img_2-1.webp 872w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/img_2-1-300x180.webp 300w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/img_2-1-768x460.webp 768w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/img_2-1-200x120.webp 200w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/img_2-1-150x90.webp 150w\" sizes=\"auto, (max-width: 872px) 100vw, 872px\"\/><\/figure>\n<p><strong>Let\u2019s break down the code<\/strong><\/p>\n<ul class=\"wp-block-list\">\n<li>pd.DataFrame will convert the sample data into a tabular format.<\/li>\n<li>query (SELECT * FROM df) will select everything in the form of the DataFrame.\u00a0<\/li>\n<li>psql.sqldf(query, locals()) will execute the SQL query on the DataFrame using the local scope.<\/li>\n<\/ul>\n<h3 class=\"wp-block-heading\" id=\"h-data-analysis-with-pandasql\">Data Analysis with pandasql<\/h3>\n<p>Once all the libraries are imported, it\u2019s time to perform the data analysis using pandasql. The below section shows a few examples of how one can enhance the data analysis by combining Pandas and SQL. To do this:<\/p>\n<h4 class=\"wp-block-heading\" id=\"h-step-1-load-the-data\">Step 1: Load the Data<\/h4>\n<pre class=\"wp-block-code\"><code># Required libraries\nimport pandas as pd\nimport pandasql as ps\nimport plotly.express as px\nimport ipywidgets as widgets\n# Load the dataset\ncar_data = pd.read_csv(\"cars_datasets.csv\")\ncar_data.head()<\/code><\/pre>\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"872\" height=\"379\" src=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/img_3.webp\" alt=\"pandasql for Data Analysis\" class=\"wp-image-235137\" srcset=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/img_3.webp 872w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/img_3-300x130.webp 300w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/img_3-768x334.webp 768w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/img_3-150x65.webp 150w\" sizes=\"auto, (max-width: 872px) 100vw, 872px\"\/><\/figure>\n<p><strong>Let\u2019s break down the code<\/strong><\/p>\n<ul class=\"wp-block-list\">\n<li>Importing the necessary libraries: pandas for handling data, pandasql for querying the DataFrames, plotly for making interactive plots.<\/li>\n<li>pd.read_csv(\u201ccars_datasets.csv\u201d) to load the data from the local directory.<\/li>\n<li>car_data.head() will display the top 5 rows.<\/li>\n<\/ul>\n<h4 class=\"wp-block-heading\" id=\"h-step-2-explore-the-data\">Step 2: Explore the Data<\/h4>\n<p>In this section, we\u2019ll try to get familiar with data by exploring things like the names of columns, the data type of the features, and whether the data has any null values or not.<\/p>\n<ol class=\"wp-block-list\">\n<li><strong>Check the column names.<\/strong><\/li>\n<\/ol>\n<pre class=\"wp-block-code\"><code># Display column names\ncolumn_names = car_data.columns\ncolumn_names\n\"\"\"\nOutput:\nIndex(['Unnamed: 0', 'price', 'brand', 'model', 'year', 'title_status',\n      'mileage', 'color', 'vin', 'lot', 'state', 'country', 'condition'],\n     dtype=\"object\")\n\"\"\u201d<\/code><\/pre>\n<ol start=\"2\" class=\"wp-block-list\">\n<li><strong>Identify the data type of the columns.<\/strong><\/li>\n<\/ol>\n<pre class=\"wp-block-code\"><code># Display dataset info\ncar_data.info()\n\"\"\"\nOuput:\n<class>\nRangeIndex: 2499 entries, 0 to 2498\nData columns (total 13 columns):\n#   Column        Non-Null Count  Dtype \n---  ------        --------------  ----- \n0   Unnamed: 0    2499 non-null   int64 \n1   price         2499 non-null   int64 \n2   brand         2499 non-null   object\n3   model         2499 non-null   object\n4   year          2499 non-null   int64 \n5   title_status  2499 non-null   object\n6   mileage       2499 non-null   float64\n7   color         2499 non-null   object\n8   vin           2499 non-null   object\n9   lot           2499 non-null   int64 \n10  state         2499 non-null   object\n11  country       2499 non-null   object\n12  condition     2499 non-null   object\ndtypes: float64(1), int64(4), object(8)\nmemory usage: 253.9+ KB\n\"\"\"<\/class><\/code><\/pre>\n<ol start=\"3\" class=\"wp-block-list\">\n<li><strong>Check for Null values.<\/strong><\/li>\n<\/ol>\n<pre class=\"wp-block-code\"><code># Check for null values\ncar_data.isnull().sum()\n\n\n\"\"\"Output:\nUnnamed: 0      0\nprice           0\nbrand           0\nmodel           0\nyear            0\ntitle_status    0\nmileage         0\ncolor           0\nvin             0\nlot             0\nstate           0\ncountry         0\ncondition       0\ndtype: int64\n\"\"\"<\/code><\/pre>\n<h4 class=\"wp-block-heading\" id=\"h-step-3-analyze-the-data\">Step 3: Analyze the Data<\/h4>\n<p>Once we have loaded the dataset into the workflow. Now we will begin by performing data analysis.<\/p>\n<h2 class=\"wp-block-heading\" id=\"h-examples-of-data-analysis-with-python-pandas-and-sql\">Examples of Data Analysis with Python Pandas and SQL<\/h2>\n<p>Now let\u2019s try using pandasql to analyze the above dataset by running some of our queries.<\/p>\n<h4 class=\"wp-block-heading\" id=\"h-query-1-selecting-the-10-most-expensive-cars\">Query 1: Selecting the 10 Most Expensive Cars<\/h4>\n<p>Let\u2019s first find the top 10 most expensive cars from the entire dataset.<\/p>\n<pre class=\"wp-block-code\"><code>def q(query):\n   return ps.sqldf(query, {'car_data': car_data})\nq(\"\"\"\nSELECT brand, model, year, price\nFROM car_data\nORDER BY price DESC\nLIMIT 10\n\"\"\")<\/code><\/pre>\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"872\" height=\"745\" src=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/img_4.webp\" alt=\"pandasql for Data Analysis | 10 most expensive cars\" class=\"wp-image-235136\" style=\"width:543px;height:auto\" srcset=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/img_4.webp 872w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/img_4-300x256.webp 300w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/img_4-768x656.webp 768w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/img_4-150x128.webp 150w\" sizes=\"auto, (max-width: 872px) 100vw, 872px\"\/><\/figure>\n<p><strong>Let\u2019s break down the code<\/strong><\/p>\n<ul class=\"wp-block-list\">\n<li>q(query) is a custom function that executes the SQL query on the DataFrame.<\/li>\n<li>The query iterates over the complete dataset and selects columns such as brand, model, year, price, and then sorts them by price in descending order.<\/li>\n<\/ul>\n<h4 class=\"wp-block-heading\" id=\"h-query-2-average-price-by-brand\">Query 2: Average Price by Brand<\/h4>\n<p>Here we\u2019ll find the average price of cars for each brand.<\/p>\n<pre class=\"wp-block-code\"><code>def q(query):\n   return ps.sqldf(query, {'car_data': car_data})\n\nq(\"\"\"\nSELECT brand, ROUND(AVG(price), 2) AS avg_price\nFROM car_data\nGROUP BY brand\nORDER BY avg_price DESC\"\"\")<\/code><\/pre>\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"872\" height=\"1106\" src=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/img_5.webp\" alt=\"Pandas and SQL for Data Analysis | Average price by brand\" class=\"wp-image-235135\" style=\"width:429px;height:auto\" srcset=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/img_5.webp 872w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/img_5-237x300.webp 237w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/img_5-768x974.webp 768w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/img_5-150x190.webp 150w\" sizes=\"auto, (max-width: 872px) 100vw, 872px\"\/><\/figure>\n<p><strong>Let\u2019s break down the code<\/strong><\/p>\n<ul class=\"wp-block-list\">\n<li>Here, the query uses AVG(price) to calculate the average price for each brand and uses round, round off the resultant to 2 decimals.<\/li>\n<li>And GROUPBY will group the data by the car brands and sort it by using the AVG(price) in descending order.<\/li>\n<\/ul>\n<h4 class=\"wp-block-heading\" id=\"h-query-3-cars-manufactured-after-2015\">Query 3: Cars Manufactured After 2015<\/h4>\n<p>Let\u2019s make a list of the cars manufactured after 2015.<\/p>\n<pre class=\"wp-block-code\"><code>def q(query):\n   return ps.sqldf(query, {'car_data': car_data})\n\nq(\"\"\"\nSELECT *\nFROM car_data\nWHERE year &gt; 2015\nORDER BY year DESC\n\"\"\")<\/code><\/pre>\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"872\" height=\"498\" src=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/img_7-1.webp\" alt=\"Cars manufactured after 2015 | pandasql\" class=\"wp-image-235133\" srcset=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/img_7-1.webp 872w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/img_7-1-300x171.webp 300w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/img_7-1-768x439.webp 768w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/img_7-1-150x86.webp 150w\" sizes=\"auto, (max-width: 872px) 100vw, 872px\"\/><\/figure>\n<p><strong>Let\u2019s break down the code<\/strong><\/p>\n<ul class=\"wp-block-list\">\n<li>Here, the query selects all the car manufacturers after 2015 and orders them in descending order.<\/li>\n<\/ul>\n<h4 class=\"wp-block-heading\" id=\"h-query-4-top-5-brands-by-number-of-cars-listed\">Query 4: Top 5 Brands by Number of Cars Listed<\/h4>\n<p>Now let\u2019s find the total number of cars produced by each brand.<\/p>\n<pre class=\"wp-block-code\"><code>def q(query):\n   return ps.sqldf(query, {'car_data': car_data})\n\nq(\"\"\"\nSELECT brand, COUNT(*) as total_listed\nFROM car_data\nGROUP BY brand\nORDER BY total_listed DESC\nLIMIT 5\n\"\"\")<\/code><\/pre>\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"972\" height=\"705\" src=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/img_8.webp\" alt=\"Pandas and SQL for Data Analysis\" class=\"wp-image-235132\" style=\"width:389px;height:auto\" srcset=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/img_8.webp 972w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/img_8-300x218.webp 300w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/img_8-768x557.webp 768w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/img_8-150x109.webp 150w\" sizes=\"auto, (max-width: 972px) 100vw, 972px\"\/><\/figure>\n<p><strong>Let\u2019s break down the code<\/strong><\/p>\n<ul class=\"wp-block-list\">\n<li>Here the query counts the total number of cars by each brand using the GROUP BY operation.<\/li>\n<li>It lists them in descending order and uses a limit of 5 to pick out only the top 5.<\/li>\n<\/ul>\n<h4 class=\"wp-block-heading\" id=\"h-query-5-average-price-by-condition\">Query 5: Average Price by Condition<\/h4>\n<p>Let\u2019s see how we can group the cars based on a condition. Here, the condition column shows the time when the listing was added or how much time is left. Based on that, we can categorize the cars and get their average pricing.<\/p>\n<pre class=\"wp-block-code\"><code>def q(query):\n   return ps.sqldf(query, {'car_data': car_data})\n\nq(\"\"\"\nSELECT condition, ROUND(AVG(price), 2) AS avg_price, COUNT(*) as listings\nFROM car_data\nGROUP BY condition\nORDER BY avg_price DESC\n\"\"\")<\/code><\/pre>\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"872\" height=\"823\" src=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/img_9.webp\" alt=\"Average Price by Condition\" class=\"wp-image-235131\" style=\"width:515px;height:auto\" srcset=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/img_9.webp 872w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/img_9-300x283.webp 300w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/img_9-768x725.webp 768w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/img_9-150x142.webp 150w\" sizes=\"auto, (max-width: 872px) 100vw, 872px\"\/><\/figure>\n<p><strong>Let\u2019s break down the code<\/strong><\/p>\n<ul class=\"wp-block-list\">\n<li>Here, the query groups the cars on condition (such as new or used) and calculates the price using AVG(Price).<\/li>\n<li>Order them in descending order to show the most expensive cars first.<\/li>\n<\/ul>\n<h4 class=\"wp-block-heading\" id=\"h-query-6-average-mileage-and-price-by-brand\">Query 6: Average Mileage and Price by Brand<\/h4>\n<p>Here we\u2019ll find the average mileage of the cars for each brand and their average price.\u00a0<\/p>\n<pre class=\"wp-block-code\"><code>def q(query):\n   return ps.sqldf(query, {'car_data': car_data})\n\nq(\"\"\"\nSELECT brand,\n      ROUND(AVG(mileage), 2) AS avg_mileage,\n      ROUND(AVG(price), 2) AS avg_price,\n      COUNT(*) AS total_listings\nFROM car_data\nGROUP BY brand\nORDER BY avg_price DESC\nLIMIT 10\n\"\"\")<\/code><\/pre>\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"872\" height=\"568\" src=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/img_10.webp\" alt=\"Pandas and SQL for Data Analysis | Average mileage and price\" class=\"wp-image-235129\" style=\"width:693px;height:auto\" srcset=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/img_10.webp 872w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/img_10-300x195.webp 300w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/img_10-768x500.webp 768w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/img_10-150x98.webp 150w\" sizes=\"auto, (max-width: 872px) 100vw, 872px\"\/><\/figure>\n<p><strong>Let\u2019s break down the code<\/strong><\/p>\n<ul class=\"wp-block-list\">\n<li>Here, the query groups the cars using brand and calculates their average mileage and average price, and counts the total number of listings of each brand in that group.<\/li>\n<li>Order them in descending order by price.<\/li>\n<\/ul>\n<h4 class=\"wp-block-heading\" id=\"h-query-7-price-per-mileage-ratio-for-top-brands\">Query 7: Price per Mileage Ratio for Top Brands<\/h4>\n<p>Now let\u2019s sort the top brands based on their calculated mileage ratio i.e. the average price per mile of the cars for each brand.<\/p>\n<pre class=\"wp-block-code\"><code>def q(query):\n   return ps.sqldf(query, {'car_data': car_data})\n\nq(\"\"\"\nSELECT brand,\n      ROUND(AVG(price\/mileage), 4) AS price_per_mile,\n      COUNT(*) AS total\nFROM car_data\nWHERE mileage &gt; 0\nGROUP BY brand\nORDER BY price_per_mile DESC\nLIMIT 10\n\"\"\")<\/code><\/pre>\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"872\" height=\"773\" src=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/img_11.webp\" alt=\"Pandas and SQL for Data Analysis | Mileage by price ratio\" class=\"wp-image-235128\" style=\"width:499px;height:auto\" srcset=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/img_11.webp 872w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/img_11-300x266.webp 300w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/img_11-768x681.webp 768w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/img_11-150x133.webp 150w\" sizes=\"auto, (max-width: 872px) 100vw, 872px\"\/><\/figure>\n<p><strong>Let\u2019s break down the code<\/strong><\/p>\n<ul class=\"wp-block-list\">\n<li>Here query calculates the price per mileage for each brand and then shows cars by each brand with that specific price per mileage. In descending order by price per mile.<\/li>\n<\/ul>\n<h4 class=\"wp-block-heading\" id=\"h-query-8-average-car-price-by-area\">Query 8: Average Car Price by Area<\/h4>\n<p>Here we\u2019ll find and plot the number of cars of each brand in a particular city.\u00a0<\/p>\n<pre class=\"wp-block-code\"><code>state_dropdown = widgets.Dropdown(\n   options=car_data['state'].unique().tolist(),\n   value=car_data['state'].unique()[0],\n   description='Select State:',\n   layout=widgets.Layout(width=\"50%\")\n)\n\ndef plot_avg_price_state(state_selected):\n   query = f\"\"\"\n       SELECT brand, AVG(price) AS avg_price\n       FROM car_data\n       WHERE state=\"{state_selected}\"\n       GROUP BY brand\n       ORDER BY avg_price DESC\n   \"\"\"\n   result = q(query)\n   fig = px.bar(result, x='brand', y='avg_price', color=\"brand\",\n                title=f\"Average Car Price in {state_selected}\")\n   fig.show()\n\nwidgets.interact(plot_avg_price_state, state_selected=state_dropdown)<\/code><\/pre>\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"872\" height=\"671\" src=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/img_12.webp\" alt=\"Pandas and SQL for Data Analysis | Average price by city\" class=\"wp-image-235127\" srcset=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/img_12.webp 872w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/img_12-300x231.webp 300w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/img_12-768x591.webp 768w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/img_12-150x115.webp 150w\" sizes=\"auto, (max-width: 872px) 100vw, 872px\"\/><\/figure>\n<p><strong>Let\u2019s break down the code<\/strong><\/p>\n<ul class=\"wp-block-list\">\n<li>State_dropdown creates a dropdown to select the different US states from the data and allows the user to select a state.<\/li>\n<li>plot_avg_price_state(state_selected) executes the query to calculate the average price per brand and gives a bar chart using plotly.<\/li>\n<li>widgets.interact() links the dropdown with the function so the chart can update on its own when the user selects a different state.<\/li>\n<\/ul>\n<p>For the notebook and the dataset used here, please visit <a href=\"https:\/\/drive.google.com\/drive\/folders\/1iGTcej0bUNTPVaN4QiJBjPNI1plXDep4?usp=sharing\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">this link.<\/a><\/p>\n<h2 class=\"wp-block-heading\" id=\"h-limitations-of-pandasql\">Limitations of pandasql<\/h2>\n<p>Even though pandasql offers many efficient functionalities and a convenient way to run SQL queries with Pandas, it also has some limitations. In this section, we\u2019ll explore these limitations and try to figure out when to rely on traditional Pandas or SQL, and when to use pandasql.<\/p>\n<ul class=\"wp-block-list\">\n<li><strong>Not compatible with large datasets:<\/strong> While we run the pandasql query creates a copy of the data in memory before complete execution of the current query. This method of executing the over queries dealing with large datasets can lead to high memory usage and slow execution.<\/li>\n<li><strong>Limited SQL Features:<\/strong>\u00a0 pandasql supports many basic SQL features, but it fails to fully implement all the advanced features like subqueries, complex joins, and window functions.<\/li>\n<li><strong>Compatibility with Complex Data<\/strong>: pandas works well with tabular data. While working with complex data, such as nested JSON or multi-index DataFrames, it fails to provide the desired results.<\/li>\n<\/ul>\n<h2 class=\"wp-block-heading\" id=\"h-conclusion\">Conclusion<\/h2>\n<p>Using Pandas and SQL together significantly improves the data analysis workflow. By leveraging pandasql, one can seamlessly run SQL queries in the DataFrames. This helps those who are familiar with SQL and want to work in Python environments. This integration of Pandas and SQL combines the flexibility of both and opens up new possibilities for data manipulation and analysis. With this, one can enhance the ability to tackle a wide range of data challenges. However, it\u2019s important to consider the limitations of pandasql as well, and explore other approaches when dealing with large and complex datasets.<\/p>\n<div class=\"border-top py-3 author-info my-4\">\n<div class=\"author-card d-flex align-items-center\">\n<div class=\"flex-shrink-0 overflow-hidden\">\n                                    <a href=\"https:\/\/www.analyticsvidhya.com\/blog\/author\/vipin355333\/\" class=\"text-decoration-none active-avatar\"><br \/>\n                                                                       <img decoding=\"async\" src=\"https:\/\/av-eks-lekhak.s3.amazonaws.com\/media\/lekhak-profile-images\/converted_image_q6dapDN.webp\" width=\"48\" height=\"48\" alt=\"Vipin Vashisth\" loading=\"lazy\" class=\"rounded-circle\"\/><\/p>\n<p>                                <\/a>\n                                <\/div>\n<\/p><\/div>\n<p>Hello! I&#8217;m Vipin, a passionate data science and machine learning enthusiast with a strong foundation in data analysis, machine learning algorithms, and programming. I have hands-on experience in building models, managing messy data, and solving real-world problems. My goal is to apply data-driven insights to create practical solutions that drive results. I&#8217;m eager to contribute my skills in a collaborative environment while continuing to learn and grow in the fields of Data Science, Machine Learning, and NLP.<\/p>\n<\/p><\/div>\n<\/p><\/div>\n<p><h4 class=\"fs-24 text-dark\">Login to continue reading and enjoy expert-curated content.<\/h4>\n<p>                        <button class=\"btn btn-primary mx-auto d-table\" data-bs-toggle=\"modal\" data-bs-target=\"#loginModal\" id=\"readMoreBtn\">Keep Reading for Free<\/button>\n                    <\/p>\n\n","protected":false},"excerpt":{"rendered":"<p>For all the tasks related to data science and machine learning, the most important thing that defines how a model will perform depends on how good our data is. Python Pandas and SQL are among the powerful tools that can help in extracting and manipulating data efficiently. By combining these two together, data analysts can [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":244953,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12033],"tags":[10990,11603,21303,21302,65481],"dealstore":[],"offerexpiration":[],"class_list":["post-244952","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-analytics","tag-analysis","tag-data","tag-pandas","tag-python","tag-sql"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.4 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to Use Python Pandas and SQL Together for Data Analysis - Som2ny Network<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/fivemor.com\/?p=244952\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Use Python Pandas and SQL Together for Data Analysis - Som2ny Network\" \/>\n<meta property=\"og:description\" content=\"For all the tasks related to data science and machine learning, the most important thing that defines how a model will perform depends on how good our data is. Python Pandas and SQL are among the powerful tools that can help in extracting and manipulating data efficiently. By combining these two together, data analysts can [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/fivemor.com\/?p=244952\" \/>\n<meta property=\"og:site_name\" content=\"Som2ny Network\" \/>\n<meta property=\"article:published_time\" content=\"2025-05-17T08:26:41+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/05\/How.webp.webp\" \/>\n\t<meta property=\"og:image:width\" content=\"872\" \/>\n\t<meta property=\"og:image:height\" content=\"473\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/webp\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"11 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/fivemor.com\/?p=244952#article\",\"isPartOf\":{\"@id\":\"https:\/\/fivemor.com\/?p=244952\"},\"author\":{\"name\":\"admin\",\"@id\":\"https:\/\/fivemor.com\/#\/schema\/person\/b85e3c3dc0e1daea076524dc8810c371\"},\"headline\":\"How to Use Python Pandas and SQL Together for Data Analysis\",\"datePublished\":\"2025-05-17T08:26:41+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/fivemor.com\/?p=244952\"},\"wordCount\":1634,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/fivemor.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/fivemor.com\/?p=244952#primaryimage\"},\"thumbnailUrl\":\"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/05\/How.webp.webp\",\"keywords\":[\"Analysis\",\"Data\",\"Pandas\",\"Python\",\"SQL\"],\"articleSection\":[\"Analytics\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/fivemor.com\/?p=244952#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/fivemor.com\/?p=244952\",\"url\":\"https:\/\/fivemor.com\/?p=244952\",\"name\":\"How to Use Python Pandas and SQL Together for Data Analysis - Som2ny Network\",\"isPartOf\":{\"@id\":\"https:\/\/fivemor.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/fivemor.com\/?p=244952#primaryimage\"},\"image\":{\"@id\":\"https:\/\/fivemor.com\/?p=244952#primaryimage\"},\"thumbnailUrl\":\"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/05\/How.webp.webp\",\"datePublished\":\"2025-05-17T08:26:41+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/fivemor.com\/?p=244952#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/fivemor.com\/?p=244952\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/fivemor.com\/?p=244952#primaryimage\",\"url\":\"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/05\/How.webp.webp\",\"contentUrl\":\"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/05\/How.webp.webp\",\"width\":872,\"height\":473},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/fivemor.com\/?p=244952#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/fivemor.com\/?bp_activities=1\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Use Python Pandas and SQL Together for Data Analysis\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/fivemor.com\/#website\",\"url\":\"https:\/\/fivemor.com\/\",\"name\":\"Som2ny Network\",\"description\":\"Daily Deals\",\"publisher\":{\"@id\":\"https:\/\/fivemor.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/fivemor.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/fivemor.com\/#organization\",\"name\":\"Som2ny Network\",\"url\":\"https:\/\/fivemor.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/fivemor.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/fivemor.com\/wp-content\/uploads\/2026\/07\/4a0953c4-logo-300x86-1.png\",\"contentUrl\":\"https:\/\/fivemor.com\/wp-content\/uploads\/2026\/07\/4a0953c4-logo-300x86-1.png\",\"width\":300,\"height\":86,\"caption\":\"Som2ny Network\"},\"image\":{\"@id\":\"https:\/\/fivemor.com\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/fivemor.com\/#\/schema\/person\/b85e3c3dc0e1daea076524dc8810c371\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/fivemor.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/729ae85bf62b9917e93538db2f2688ca?s=96&r=g&default=https%3A%2F%2Ffivemor.com%2Fwp-content%2Fplugins%2Fbuddypress-first-letter-avatar%2Fimages%2Fdefault%2F96%2Flatin_a.png\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/729ae85bf62b9917e93538db2f2688ca?s=96&r=g&default=https%3A%2F%2Ffivemor.com%2Fwp-content%2Fplugins%2Fbuddypress-first-letter-avatar%2Fimages%2Fdefault%2F96%2Flatin_a.png\",\"caption\":\"admin\"},\"sameAs\":[\"https:\/\/fivemor.com\"],\"url\":\"https:\/\/fivemor.com\/?author=1\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Use Python Pandas and SQL Together for Data Analysis - Som2ny Network","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/fivemor.com\/?p=244952","og_locale":"en_US","og_type":"article","og_title":"How to Use Python Pandas and SQL Together for Data Analysis - Som2ny Network","og_description":"For all the tasks related to data science and machine learning, the most important thing that defines how a model will perform depends on how good our data is. Python Pandas and SQL are among the powerful tools that can help in extracting and manipulating data efficiently. By combining these two together, data analysts can [&hellip;]","og_url":"https:\/\/fivemor.com\/?p=244952","og_site_name":"Som2ny Network","article_published_time":"2025-05-17T08:26:41+00:00","og_image":[{"width":872,"height":473,"url":"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/05\/How.webp.webp","type":"image\/webp"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"Written by":"admin","Est. reading time":"11 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/fivemor.com\/?p=244952#article","isPartOf":{"@id":"https:\/\/fivemor.com\/?p=244952"},"author":{"name":"admin","@id":"https:\/\/fivemor.com\/#\/schema\/person\/b85e3c3dc0e1daea076524dc8810c371"},"headline":"How to Use Python Pandas and SQL Together for Data Analysis","datePublished":"2025-05-17T08:26:41+00:00","mainEntityOfPage":{"@id":"https:\/\/fivemor.com\/?p=244952"},"wordCount":1634,"commentCount":0,"publisher":{"@id":"https:\/\/fivemor.com\/#organization"},"image":{"@id":"https:\/\/fivemor.com\/?p=244952#primaryimage"},"thumbnailUrl":"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/05\/How.webp.webp","keywords":["Analysis","Data","Pandas","Python","SQL"],"articleSection":["Analytics"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/fivemor.com\/?p=244952#respond"]}]},{"@type":"WebPage","@id":"https:\/\/fivemor.com\/?p=244952","url":"https:\/\/fivemor.com\/?p=244952","name":"How to Use Python Pandas and SQL Together for Data Analysis - Som2ny Network","isPartOf":{"@id":"https:\/\/fivemor.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/fivemor.com\/?p=244952#primaryimage"},"image":{"@id":"https:\/\/fivemor.com\/?p=244952#primaryimage"},"thumbnailUrl":"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/05\/How.webp.webp","datePublished":"2025-05-17T08:26:41+00:00","breadcrumb":{"@id":"https:\/\/fivemor.com\/?p=244952#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/fivemor.com\/?p=244952"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/fivemor.com\/?p=244952#primaryimage","url":"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/05\/How.webp.webp","contentUrl":"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/05\/How.webp.webp","width":872,"height":473},{"@type":"BreadcrumbList","@id":"https:\/\/fivemor.com\/?p=244952#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/fivemor.com\/?bp_activities=1"},{"@type":"ListItem","position":2,"name":"How to Use Python Pandas and SQL Together for Data Analysis"}]},{"@type":"WebSite","@id":"https:\/\/fivemor.com\/#website","url":"https:\/\/fivemor.com\/","name":"Som2ny Network","description":"Daily Deals","publisher":{"@id":"https:\/\/fivemor.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/fivemor.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/fivemor.com\/#organization","name":"Som2ny Network","url":"https:\/\/fivemor.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/fivemor.com\/#\/schema\/logo\/image\/","url":"https:\/\/fivemor.com\/wp-content\/uploads\/2026\/07\/4a0953c4-logo-300x86-1.png","contentUrl":"https:\/\/fivemor.com\/wp-content\/uploads\/2026\/07\/4a0953c4-logo-300x86-1.png","width":300,"height":86,"caption":"Som2ny Network"},"image":{"@id":"https:\/\/fivemor.com\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/fivemor.com\/#\/schema\/person\/b85e3c3dc0e1daea076524dc8810c371","name":"admin","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/fivemor.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/729ae85bf62b9917e93538db2f2688ca?s=96&r=g&default=https%3A%2F%2Ffivemor.com%2Fwp-content%2Fplugins%2Fbuddypress-first-letter-avatar%2Fimages%2Fdefault%2F96%2Flatin_a.png","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/729ae85bf62b9917e93538db2f2688ca?s=96&r=g&default=https%3A%2F%2Ffivemor.com%2Fwp-content%2Fplugins%2Fbuddypress-first-letter-avatar%2Fimages%2Fdefault%2F96%2Flatin_a.png","caption":"admin"},"sameAs":["https:\/\/fivemor.com"],"url":"https:\/\/fivemor.com\/?author=1"}]}},"_links":{"self":[{"href":"https:\/\/fivemor.com\/index.php?rest_route=\/wp\/v2\/posts\/244952","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fivemor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fivemor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=244952"}],"version-history":[{"count":0,"href":"https:\/\/fivemor.com\/index.php?rest_route=\/wp\/v2\/posts\/244952\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=\/wp\/v2\/media\/244953"}],"wp:attachment":[{"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=244952"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=244952"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=244952"},{"taxonomy":"dealstore","embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fdealstore&post=244952"},{"taxonomy":"offerexpiration","embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fofferexpiration&post=244952"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}