Import all Python Data Science packages for the analysis
import pandas as pd
import numpy as np
from pprint import pprint
import io
import os
from bs4 import BeautifulSoup
import requests,json, re
from selenium import webdriver
from webdriver_manager.chrome import ChromeDriverManager
df = pd.read_csv("/Users/owner/Desktop/DS_AI_projects/web_scraping/data.csv")
df = df.drop(columns=["cuisine_type"])
df.head(20)

As we can see, there is a bunch of missing data, so let’s fill that with “None”. I’ve also noticed that some of the values in the “pricing” and “rating” columns is not in the correct int64 format, so I’ll change that.
df["type2"].fillna("None", inplace=**True**)
df["type3"].fillna("None", inplace=**True**)
df["pricing"] = df["pricing"].apply(lambda x: str(len(x)))
df["rating"] = df["rating"].apply(lambda x: float(x.strip("star rating")))
Take a Look at Mean Ratings
np.mean(df['rating'])

The average rating of restaurants across Davis is about 3.87, a fairly high average. It's safe to say that Davis local businesses in general have a positive public perception. But this information is too general. Let’s dive deeper!
vis = df.groupby("rating")["votes"].sum()
vis = pd.DataFrame(vis).reset_index()
vis

Graph the ratings and the votes
**import** **plotly.express** **as** **px**
fig = px.bar(vis, x="rating", y="votes", title="Rating vs Votes")
fig.show()

fig = px.bar(df, x="rating", y="votes", color="pricing", title="Popularity of Davis Restaurants Based on Count and Pricing")
fig.show()

df["rating"].value_counts()