Spaces:
Sleeping
Sleeping
Khang Nguyen
commited on
Commit
·
aa893a9
1
Parent(s):
4172f8b
inital commit
Browse files- README.md +169 -12
- __pycache__/data_processor.cpython-313.pyc +0 -0
- __pycache__/insights.cpython-313.pyc +0 -0
- __pycache__/test_data_processor.cpython-313-pytest-8.4.2.pyc +0 -0
- __pycache__/test_insights.cpython-313-pytest-8.4.2.pyc +0 -0
- __pycache__/test_visualizations.cpython-313-pytest-8.4.2.pyc +0 -0
- __pycache__/utils.cpython-313.pyc +0 -0
- __pycache__/visualizations.cpython-313.pyc +0 -0
- app.py +625 -0
- data/.DS_Store +0 -0
- data/tesla_clean_full.csv +0 -0
- data/tesla_deliveries_1k.csv +1001 -0
- data/tesla_deliveries_50k.csv +0 -0
- data_processor.py +302 -0
- insights.py +240 -0
- prepare_tesla_data.py +194 -0
- requirements.txt +6 -0
- utils.py +37 -0
- visualizations.py +330 -0
README.md
CHANGED
|
@@ -1,12 +1,169 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Tesla Production & Deliveries Dashboard
|
| 2 |
+
|
| 3 |
+
CS 5130 – Final Project (Gradio + pandas)
|
| 4 |
+
|
| 5 |
+
📌 Project Overview
|
| 6 |
+
|
| 7 |
+
This project is an interactive Business Intelligence Dashboard built using Gradio and pandas.
|
| 8 |
+
It helps non-technical users explore and understand business data.
|
| 9 |
+
The dashboard allows users to:
|
| 10 |
+
|
| 11 |
+
Upload datasets (CSV or Excel)
|
| 12 |
+
|
| 13 |
+
View basic statistics
|
| 14 |
+
|
| 15 |
+
Apply interactive filters
|
| 16 |
+
|
| 17 |
+
Create different types of visualizations
|
| 18 |
+
|
| 19 |
+
Generate automated insights
|
| 20 |
+
|
| 21 |
+
Export data and charts
|
| 22 |
+
|
| 23 |
+
Two sample Tesla datasets (1K rows and 50K rows) are included for testing and demonstration.
|
| 24 |
+
|
| 25 |
+
⭐ Key Features
|
| 26 |
+
1. Data Upload & Validation
|
| 27 |
+
|
| 28 |
+
Upload CSV or Excel files
|
| 29 |
+
|
| 30 |
+
Built-in Tesla sample datasets
|
| 31 |
+
|
| 32 |
+
Automatic detection of:
|
| 33 |
+
|
| 34 |
+
Numeric columns
|
| 35 |
+
|
| 36 |
+
Categorical columns
|
| 37 |
+
|
| 38 |
+
Date columns
|
| 39 |
+
|
| 40 |
+
Dataset preview
|
| 41 |
+
|
| 42 |
+
Clear error handling and messages
|
| 43 |
+
|
| 44 |
+
2. Summary Statistics
|
| 45 |
+
|
| 46 |
+
Numeric summary (mean, median, std, min, max, quartiles)
|
| 47 |
+
|
| 48 |
+
Categorical summary (unique values, mode, frequency)
|
| 49 |
+
|
| 50 |
+
Missing value report
|
| 51 |
+
|
| 52 |
+
Correlation heatmap for numeric columns
|
| 53 |
+
|
| 54 |
+
3. Interactive Filtering
|
| 55 |
+
|
| 56 |
+
Numeric range filters
|
| 57 |
+
|
| 58 |
+
Categorical multi-select filters
|
| 59 |
+
|
| 60 |
+
Date range filters
|
| 61 |
+
|
| 62 |
+
Filtered data preview
|
| 63 |
+
|
| 64 |
+
Export filtered result to CSV
|
| 65 |
+
|
| 66 |
+
4. Visualizations
|
| 67 |
+
|
| 68 |
+
Supports at least 4 required chart types:
|
| 69 |
+
|
| 70 |
+
Time series plot
|
| 71 |
+
|
| 72 |
+
Histogram
|
| 73 |
+
|
| 74 |
+
Box plot
|
| 75 |
+
|
| 76 |
+
Category bar chart
|
| 77 |
+
|
| 78 |
+
Scatter plot
|
| 79 |
+
|
| 80 |
+
Correlation heatmap
|
| 81 |
+
|
| 82 |
+
Additional features:
|
| 83 |
+
|
| 84 |
+
User selects columns
|
| 85 |
+
|
| 86 |
+
Supports aggregation (sum, mean, count, median)
|
| 87 |
+
|
| 88 |
+
Download charts as PNG
|
| 89 |
+
|
| 90 |
+
5. Automated Insights
|
| 91 |
+
|
| 92 |
+
Top and bottom performing models
|
| 93 |
+
|
| 94 |
+
Region ranking by estimated deliveries
|
| 95 |
+
|
| 96 |
+
Production vs. delivery comparison
|
| 97 |
+
|
| 98 |
+
Overall trend summary
|
| 99 |
+
|
| 100 |
+
📁 Project Structure
|
| 101 |
+
|
| 102 |
+
project/
|
| 103 |
+
|
| 104 |
+
│── app.py # Main Gradio application
|
| 105 |
+
|
| 106 |
+
│── data_processor.py # Data loading, cleaning, filtering
|
| 107 |
+
|
| 108 |
+
│── visualizations.py # Chart creation functions
|
| 109 |
+
|
| 110 |
+
│── insights.py # Insight generation functions
|
| 111 |
+
|
| 112 |
+
│── utils.py # Helper utilities
|
| 113 |
+
|
| 114 |
+
│── prepare_tesla_data.py # Synthetic dataset generator
|
| 115 |
+
|
| 116 |
+
│── requirements.txt # Dependencies
|
| 117 |
+
|
| 118 |
+
│── README.md # Documentation
|
| 119 |
+
|
| 120 |
+
└── data/
|
| 121 |
+
|
| 122 |
+
├── tesla_deliveries_1k.csv
|
| 123 |
+
|
| 124 |
+
└── tesla_deliveries_50k.csv
|
| 125 |
+
|
| 126 |
+
▶ How to Run
|
| 127 |
+
1. Install dependencies
|
| 128 |
+
pip install -r requirements.txt
|
| 129 |
+
|
| 130 |
+
2. Run the Gradio app
|
| 131 |
+
python app.py
|
| 132 |
+
|
| 133 |
+
3. Open the browser link
|
| 134 |
+
|
| 135 |
+
Gradio will show a local URL such as:
|
| 136 |
+
|
| 137 |
+
http://127.0.0.1:7860
|
| 138 |
+
|
| 139 |
+
🧰 Technologies Used
|
| 140 |
+
|
| 141 |
+
Python
|
| 142 |
+
|
| 143 |
+
pandas
|
| 144 |
+
|
| 145 |
+
NumPy
|
| 146 |
+
|
| 147 |
+
Matplotlib / Seaborn
|
| 148 |
+
|
| 149 |
+
Gradio
|
| 150 |
+
|
| 151 |
+
🤖 Use of AI Tools
|
| 152 |
+
|
| 153 |
+
AI tools (ChatGPT / Claude / GitHub Copilot) were used for:
|
| 154 |
+
|
| 155 |
+
Code suggestions
|
| 156 |
+
|
| 157 |
+
Debugging
|
| 158 |
+
|
| 159 |
+
Improving documentation
|
| 160 |
+
|
| 161 |
+
Refining design ideas
|
| 162 |
+
|
| 163 |
+
All AI-generated code was reviewed, tested, and modified by me to ensure it works for this project.
|
| 164 |
+
|
| 165 |
+
📌 Notes
|
| 166 |
+
|
| 167 |
+
Sample Tesla datasets are synthetic and created for class demonstration.
|
| 168 |
+
|
| 169 |
+
Dashboard is for educational use only.
|
__pycache__/data_processor.cpython-313.pyc
ADDED
|
Binary file (9.44 kB). View file
|
|
|
__pycache__/insights.cpython-313.pyc
ADDED
|
Binary file (8.74 kB). View file
|
|
|
__pycache__/test_data_processor.cpython-313-pytest-8.4.2.pyc
ADDED
|
Binary file (1 kB). View file
|
|
|
__pycache__/test_insights.cpython-313-pytest-8.4.2.pyc
ADDED
|
Binary file (1.79 kB). View file
|
|
|
__pycache__/test_visualizations.cpython-313-pytest-8.4.2.pyc
ADDED
|
Binary file (3.8 kB). View file
|
|
|
__pycache__/utils.cpython-313.pyc
ADDED
|
Binary file (1.61 kB). View file
|
|
|
__pycache__/visualizations.cpython-313.pyc
ADDED
|
Binary file (12.5 kB). View file
|
|
|
app.py
ADDED
|
@@ -0,0 +1,625 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
import pandas as pd
|
| 3 |
+
|
| 4 |
+
from data_processor import (
|
| 5 |
+
load_data,
|
| 6 |
+
get_basic_info,
|
| 7 |
+
detect_column_types,
|
| 8 |
+
numeric_summary,
|
| 9 |
+
categorical_summary,
|
| 10 |
+
missing_values_report,
|
| 11 |
+
correlation_matrix,
|
| 12 |
+
build_filter_metadata,
|
| 13 |
+
apply_filters,
|
| 14 |
+
)
|
| 15 |
+
|
| 16 |
+
from visualizations import (
|
| 17 |
+
create_time_series_plot,
|
| 18 |
+
create_distribution_plot,
|
| 19 |
+
create_category_bar_plot,
|
| 20 |
+
create_scatter_plot,
|
| 21 |
+
create_correlation_heatmap,
|
| 22 |
+
)
|
| 23 |
+
|
| 24 |
+
from insights import (
|
| 25 |
+
region_ranking,
|
| 26 |
+
top_bottom_groups,
|
| 27 |
+
model_production_vs_delivery,
|
| 28 |
+
overall_trend_summary,
|
| 29 |
+
)
|
| 30 |
+
|
| 31 |
+
from utils import figure_to_png_bytes, dict_to_text
|
| 32 |
+
|
| 33 |
+
|
| 34 |
+
# -----------------------------
|
| 35 |
+
# Helper functions for loading
|
| 36 |
+
# -----------------------------
|
| 37 |
+
def load_any_source(file_or_path):
|
| 38 |
+
"""
|
| 39 |
+
Common loader for both uploaded files and sample CSV paths.
|
| 40 |
+
Returns:
|
| 41 |
+
df, meta, col_types, info_dict, preview_df, error_message
|
| 42 |
+
"""
|
| 43 |
+
df, err = load_data(file_or_path)
|
| 44 |
+
if err:
|
| 45 |
+
return None, None, None, None, None, err
|
| 46 |
+
|
| 47 |
+
info = get_basic_info(df)
|
| 48 |
+
col_types = detect_column_types(df)
|
| 49 |
+
meta = build_filter_metadata(df, col_types)
|
| 50 |
+
preview = df.head(20)
|
| 51 |
+
return df, meta, col_types, info, preview, None
|
| 52 |
+
|
| 53 |
+
|
| 54 |
+
# ============================================================
|
| 55 |
+
# Gradio app
|
| 56 |
+
# ============================================================
|
| 57 |
+
def create_dashboard():
|
| 58 |
+
with gr.Blocks(theme=gr.themes.Soft()) as demo:
|
| 59 |
+
gr.Markdown("# 🚗 Tesla Production & Deliveries Dashboard")
|
| 60 |
+
gr.Markdown(
|
| 61 |
+
"Upload data or use the built-in Tesla samples to explore statistics, "
|
| 62 |
+
"filter data, visualize trends, and generate insights."
|
| 63 |
+
)
|
| 64 |
+
|
| 65 |
+
# Shared state across tabs
|
| 66 |
+
df_state = gr.State(None)
|
| 67 |
+
meta_state = gr.State(None)
|
| 68 |
+
col_types_state = gr.State(None)
|
| 69 |
+
|
| 70 |
+
# ----------------------------------------------------
|
| 71 |
+
# 1. DATA UPLOAD TAB
|
| 72 |
+
# ----------------------------------------------------
|
| 73 |
+
with gr.Tab("Data Upload"):
|
| 74 |
+
gr.Markdown("### Upload your own file or use one of the sample Tesla datasets")
|
| 75 |
+
|
| 76 |
+
file_input = gr.File(label="Upload CSV or Excel File")
|
| 77 |
+
load_btn = gr.Button("Load Uploaded Data")
|
| 78 |
+
|
| 79 |
+
sample_small_btn = gr.Button("Load Tesla Sample (1K rows)")
|
| 80 |
+
sample_large_btn = gr.Button("Load Tesla Sample (50K rows)")
|
| 81 |
+
|
| 82 |
+
info_box = gr.JSON(label="Dataset Info")
|
| 83 |
+
preview_box = gr.Dataframe(label="Preview (first 20 rows)", interactive=False)
|
| 84 |
+
error_box = gr.Markdown(label="Messages")
|
| 85 |
+
|
| 86 |
+
# ----------------------------------------------------
|
| 87 |
+
# 2. STATISTICS TAB
|
| 88 |
+
# ----------------------------------------------------
|
| 89 |
+
with gr.Tab("Statistics"):
|
| 90 |
+
gr.Markdown("### Summary Statistics")
|
| 91 |
+
|
| 92 |
+
num_stats = gr.Dataframe(label="Numeric Summary", interactive=False, visible=False)
|
| 93 |
+
cat_stats = gr.Dataframe(label="Categorical Summary", interactive=False, visible=False)
|
| 94 |
+
missing_stats = gr.Dataframe(label="Missing Values", interactive=False, visible=False)
|
| 95 |
+
corr_plot = gr.Plot(label="Correlation Heatmap", visible=False)
|
| 96 |
+
|
| 97 |
+
show_stats_btn = gr.Button("Generate Statistics")
|
| 98 |
+
|
| 99 |
+
# ----------------------------------------------------
|
| 100 |
+
# 3. FILTER & EXPLORE TAB
|
| 101 |
+
# ----------------------------------------------------
|
| 102 |
+
with gr.Tab("Filter & Explore"):
|
| 103 |
+
gr.Markdown("### Apply Filters to Explore the Dataset")
|
| 104 |
+
|
| 105 |
+
# Numeric filter
|
| 106 |
+
gr.Markdown("**Numeric Filter (optional)**")
|
| 107 |
+
with gr.Row():
|
| 108 |
+
filt_num_col = gr.Dropdown(label="Numeric Column", choices=[], interactive=True)
|
| 109 |
+
filt_num_min = gr.Number(label="Min value")
|
| 110 |
+
filt_num_max = gr.Number(label="Max value")
|
| 111 |
+
|
| 112 |
+
# Categorical filter
|
| 113 |
+
gr.Markdown("**Categorical Filter (optional)**")
|
| 114 |
+
with gr.Row():
|
| 115 |
+
filt_cat_col = gr.Dropdown(label="Categorical Column", choices=[], interactive=True)
|
| 116 |
+
filt_cat_vals = gr.Dropdown(
|
| 117 |
+
label="Allowed Values", choices=[], multiselect=True, interactive=True
|
| 118 |
+
)
|
| 119 |
+
|
| 120 |
+
# Date filter
|
| 121 |
+
gr.Markdown("**Date Filter (optional)**")
|
| 122 |
+
with gr.Row():
|
| 123 |
+
filt_date_col = gr.Dropdown(label="Date Column", choices=[], interactive=True)
|
| 124 |
+
filt_date_start = gr.Textbox(label="Start date (YYYY-MM-DD)")
|
| 125 |
+
filt_date_end = gr.Textbox(label="End date (YYYY-MM-DD)")
|
| 126 |
+
|
| 127 |
+
apply_filters_btn = gr.Button("Apply Filters")
|
| 128 |
+
|
| 129 |
+
filtered_preview = gr.Dataframe(
|
| 130 |
+
label="Filtered Data Preview", interactive=False, visible=False
|
| 131 |
+
)
|
| 132 |
+
|
| 133 |
+
export_filtered_btn = gr.Button("Export Filtered Data")
|
| 134 |
+
filtered_download = gr.File(label="Download CSV")
|
| 135 |
+
|
| 136 |
+
# ----------------------------------------------------
|
| 137 |
+
# 4. VISUALIZATIONS TAB
|
| 138 |
+
# ----------------------------------------------------
|
| 139 |
+
with gr.Tab("Visualizations"):
|
| 140 |
+
gr.Markdown("### Create Charts")
|
| 141 |
+
|
| 142 |
+
chart_type = gr.Dropdown(
|
| 143 |
+
[
|
| 144 |
+
"Time Series",
|
| 145 |
+
"Histogram",
|
| 146 |
+
"Box Plot",
|
| 147 |
+
"Category Bar",
|
| 148 |
+
"Scatter",
|
| 149 |
+
"Correlation Heatmap",
|
| 150 |
+
],
|
| 151 |
+
label="Chart Type",
|
| 152 |
+
value="Time Series",
|
| 153 |
+
)
|
| 154 |
+
|
| 155 |
+
x_col = gr.Dropdown(label="X Column (for Scatter)", choices=[], interactive=True)
|
| 156 |
+
y_col = gr.Dropdown(label="Y Column (for Scatter)", choices=[], interactive=True)
|
| 157 |
+
date_col = gr.Dropdown(label="Date Column (for Time Series)", choices=[], interactive=True)
|
| 158 |
+
value_col = gr.Dropdown(label="Value Column", choices=[], interactive=True)
|
| 159 |
+
category_col = gr.Dropdown(
|
| 160 |
+
label="Category Column (optional)", choices=[], interactive=True
|
| 161 |
+
)
|
| 162 |
+
|
| 163 |
+
agg_func = gr.Dropdown(
|
| 164 |
+
["sum", "mean", "count", "median"],
|
| 165 |
+
label="Aggregation (for Time Series / Category Bar)",
|
| 166 |
+
value="sum",
|
| 167 |
+
)
|
| 168 |
+
freq = gr.Dropdown(
|
| 169 |
+
["M", "Q", "Y"],
|
| 170 |
+
label="Resample Frequency (Time Series)",
|
| 171 |
+
value="Q",
|
| 172 |
+
)
|
| 173 |
+
|
| 174 |
+
viz_btn = gr.Button("Generate Chart")
|
| 175 |
+
viz_plot = gr.Plot(label="Visualization")
|
| 176 |
+
viz_download = gr.File(label="Download PNG")
|
| 177 |
+
|
| 178 |
+
# ----------------------------------------------------
|
| 179 |
+
# 5. INSIGHTS TAB
|
| 180 |
+
# ----------------------------------------------------
|
| 181 |
+
with gr.Tab("Insights"):
|
| 182 |
+
gr.Markdown("### Automatic Insights")
|
| 183 |
+
|
| 184 |
+
gr.Markdown("#### Region Ranking (by Estimated Deliveries)")
|
| 185 |
+
region_rank_tb = gr.Dataframe(
|
| 186 |
+
label="Regions ranked by total Estimated Deliveries",
|
| 187 |
+
interactive=False,
|
| 188 |
+
visible=False,
|
| 189 |
+
)
|
| 190 |
+
|
| 191 |
+
gr.Markdown("#### Top / Bottom Models (by Estimated Deliveries)")
|
| 192 |
+
model_top_tb = gr.Dataframe(
|
| 193 |
+
label="Top Models", interactive=False, visible=False
|
| 194 |
+
)
|
| 195 |
+
model_bottom_tb = gr.Dataframe(
|
| 196 |
+
label="Bottom Models", interactive=False, visible=False
|
| 197 |
+
)
|
| 198 |
+
|
| 199 |
+
gr.Markdown("#### Model Production vs Estimated Deliveries")
|
| 200 |
+
model_comp_tb = gr.Dataframe(
|
| 201 |
+
label="Production vs Deliveries by Model",
|
| 202 |
+
interactive=False,
|
| 203 |
+
visible=False,
|
| 204 |
+
)
|
| 205 |
+
|
| 206 |
+
trend_text = gr.Textbox(
|
| 207 |
+
label="Overall Trend Summary",
|
| 208 |
+
lines=10,
|
| 209 |
+
interactive=False,
|
| 210 |
+
value="Click 'Generate Insights' after loading a dataset.",
|
| 211 |
+
)
|
| 212 |
+
|
| 213 |
+
insights_btn = gr.Button("Generate Insights")
|
| 214 |
+
|
| 215 |
+
# =====================================================
|
| 216 |
+
# CALLBACK IMPLEMENTATIONS
|
| 217 |
+
# =====================================================
|
| 218 |
+
|
| 219 |
+
# ---------- Load handlers ----------
|
| 220 |
+
def handle_load(source):
|
| 221 |
+
df, meta, col_types, info, preview, err = load_any_source(source)
|
| 222 |
+
if err:
|
| 223 |
+
# Clear states and dropdowns, show error
|
| 224 |
+
empty_df_update = gr.update(value=None, visible=False)
|
| 225 |
+
empty_choices = gr.update(choices=[], value=None)
|
| 226 |
+
|
| 227 |
+
return (
|
| 228 |
+
None, # df_state
|
| 229 |
+
None, # meta_state
|
| 230 |
+
None, # col_types_state
|
| 231 |
+
{"error": err}, # info_box
|
| 232 |
+
None, # preview_box
|
| 233 |
+
f"❌ {err}", # error_box
|
| 234 |
+
empty_choices, # filt_num_col
|
| 235 |
+
empty_choices, # filt_cat_col
|
| 236 |
+
empty_choices, # filt_date_col
|
| 237 |
+
empty_choices, # x_col
|
| 238 |
+
empty_choices, # y_col
|
| 239 |
+
empty_choices, # date_col
|
| 240 |
+
empty_choices, # value_col
|
| 241 |
+
empty_choices, # category_col
|
| 242 |
+
)
|
| 243 |
+
|
| 244 |
+
# Normal case
|
| 245 |
+
numeric_cols = col_types["numeric"]
|
| 246 |
+
categorical_cols = col_types["categorical"]
|
| 247 |
+
date_cols = col_types["date"]
|
| 248 |
+
|
| 249 |
+
num_choice_update = gr.update(choices=numeric_cols, value=None)
|
| 250 |
+
cat_choice_update = gr.update(choices=categorical_cols, value=None)
|
| 251 |
+
date_choice_update = gr.update(choices=date_cols, value=None)
|
| 252 |
+
|
| 253 |
+
return (
|
| 254 |
+
df, # df_state
|
| 255 |
+
meta, # meta_state
|
| 256 |
+
col_types, # col_types_state
|
| 257 |
+
info, # info_box
|
| 258 |
+
preview, # preview_box
|
| 259 |
+
"✅ Data loaded successfully.", # error_box
|
| 260 |
+
num_choice_update, # filt_num_col
|
| 261 |
+
cat_choice_update, # filt_cat_col
|
| 262 |
+
date_choice_update, # filt_date_col
|
| 263 |
+
num_choice_update, # x_col
|
| 264 |
+
num_choice_update, # y_col
|
| 265 |
+
date_choice_update, # date_col
|
| 266 |
+
num_choice_update, # value_col
|
| 267 |
+
cat_choice_update, # category_col
|
| 268 |
+
)
|
| 269 |
+
|
| 270 |
+
load_btn.click(
|
| 271 |
+
handle_load,
|
| 272 |
+
inputs=[file_input],
|
| 273 |
+
outputs=[
|
| 274 |
+
df_state,
|
| 275 |
+
meta_state,
|
| 276 |
+
col_types_state,
|
| 277 |
+
info_box,
|
| 278 |
+
preview_box,
|
| 279 |
+
error_box,
|
| 280 |
+
filt_num_col,
|
| 281 |
+
filt_cat_col,
|
| 282 |
+
filt_date_col,
|
| 283 |
+
x_col,
|
| 284 |
+
y_col,
|
| 285 |
+
date_col,
|
| 286 |
+
value_col,
|
| 287 |
+
category_col,
|
| 288 |
+
],
|
| 289 |
+
)
|
| 290 |
+
|
| 291 |
+
def load_sample_small():
|
| 292 |
+
return handle_load("data/tesla_deliveries_1k.csv")
|
| 293 |
+
|
| 294 |
+
def load_sample_large():
|
| 295 |
+
return handle_load("data/tesla_deliveries_50k.csv")
|
| 296 |
+
|
| 297 |
+
sample_small_btn.click(
|
| 298 |
+
load_sample_small,
|
| 299 |
+
inputs=[],
|
| 300 |
+
outputs=[
|
| 301 |
+
df_state,
|
| 302 |
+
meta_state,
|
| 303 |
+
col_types_state,
|
| 304 |
+
info_box,
|
| 305 |
+
preview_box,
|
| 306 |
+
error_box,
|
| 307 |
+
filt_num_col,
|
| 308 |
+
filt_cat_col,
|
| 309 |
+
filt_date_col,
|
| 310 |
+
x_col,
|
| 311 |
+
y_col,
|
| 312 |
+
date_col,
|
| 313 |
+
value_col,
|
| 314 |
+
category_col,
|
| 315 |
+
],
|
| 316 |
+
)
|
| 317 |
+
|
| 318 |
+
sample_large_btn.click(
|
| 319 |
+
load_sample_large,
|
| 320 |
+
inputs=[],
|
| 321 |
+
outputs=[
|
| 322 |
+
df_state,
|
| 323 |
+
meta_state,
|
| 324 |
+
col_types_state,
|
| 325 |
+
info_box,
|
| 326 |
+
preview_box,
|
| 327 |
+
error_box,
|
| 328 |
+
filt_num_col,
|
| 329 |
+
filt_cat_col,
|
| 330 |
+
filt_date_col,
|
| 331 |
+
x_col,
|
| 332 |
+
y_col,
|
| 333 |
+
date_col,
|
| 334 |
+
value_col,
|
| 335 |
+
category_col,
|
| 336 |
+
],
|
| 337 |
+
)
|
| 338 |
+
|
| 339 |
+
# ---------- Statistics ----------
|
| 340 |
+
def show_stats(df, col_types):
|
| 341 |
+
if df is None or col_types is None:
|
| 342 |
+
empty_df = gr.update(value=None, visible=False)
|
| 343 |
+
empty_plot = gr.update(value=None, visible=False)
|
| 344 |
+
return empty_df, empty_df, empty_df, empty_plot
|
| 345 |
+
|
| 346 |
+
numeric_cols = col_types["numeric"]
|
| 347 |
+
categorical_cols = col_types["categorical"]
|
| 348 |
+
|
| 349 |
+
num_df = numeric_summary(df, numeric_cols)
|
| 350 |
+
cat_df = categorical_summary(df, categorical_cols)
|
| 351 |
+
miss_df = missing_values_report(df)
|
| 352 |
+
fig = create_correlation_heatmap(df, numeric_cols)
|
| 353 |
+
|
| 354 |
+
num_u = gr.update(value=num_df, visible=True)
|
| 355 |
+
cat_u = gr.update(value=cat_df, visible=True)
|
| 356 |
+
miss_u = gr.update(value=miss_df, visible=True)
|
| 357 |
+
corr_u = (
|
| 358 |
+
gr.update(value=fig, visible=True)
|
| 359 |
+
if fig is not None
|
| 360 |
+
else gr.update(value=None, visible=False)
|
| 361 |
+
)
|
| 362 |
+
return num_u, cat_u, miss_u, corr_u
|
| 363 |
+
|
| 364 |
+
show_stats_btn.click(
|
| 365 |
+
show_stats,
|
| 366 |
+
inputs=[df_state, col_types_state],
|
| 367 |
+
outputs=[num_stats, cat_stats, missing_stats, corr_plot],
|
| 368 |
+
)
|
| 369 |
+
|
| 370 |
+
# ---------- Filter metadata helpers ----------
|
| 371 |
+
def update_numeric_bounds(meta, col_name):
|
| 372 |
+
if meta is None or not col_name:
|
| 373 |
+
return gr.update(value=None), gr.update(value=None)
|
| 374 |
+
info = meta["numeric"].get(col_name)
|
| 375 |
+
if not info:
|
| 376 |
+
return gr.update(value=None), gr.update(value=None)
|
| 377 |
+
return gr.update(value=info["min"]), gr.update(value=info["max"])
|
| 378 |
+
|
| 379 |
+
def update_categorical_values(meta, col_name):
|
| 380 |
+
if meta is None or not col_name:
|
| 381 |
+
return gr.update(choices=[], value=[])
|
| 382 |
+
values = meta["categorical"].get(col_name, [])
|
| 383 |
+
return gr.update(choices=values, value=[])
|
| 384 |
+
|
| 385 |
+
def update_date_bounds(meta, col_name):
|
| 386 |
+
if meta is None or not col_name:
|
| 387 |
+
return gr.update(value=""), gr.update(value="")
|
| 388 |
+
info = meta["date"].get(col_name)
|
| 389 |
+
if not info:
|
| 390 |
+
return gr.update(value=""), gr.update(value="")
|
| 391 |
+
start = str(info["min"]).split(" ")[0]
|
| 392 |
+
end = str(info["max"]).split(" ")[0]
|
| 393 |
+
return gr.update(value=start), gr.update(value=end)
|
| 394 |
+
|
| 395 |
+
filt_num_col.change(
|
| 396 |
+
update_numeric_bounds,
|
| 397 |
+
inputs=[meta_state, filt_num_col],
|
| 398 |
+
outputs=[filt_num_min, filt_num_max],
|
| 399 |
+
)
|
| 400 |
+
|
| 401 |
+
filt_cat_col.change(
|
| 402 |
+
update_categorical_values,
|
| 403 |
+
inputs=[meta_state, filt_cat_col],
|
| 404 |
+
outputs=[filt_cat_vals],
|
| 405 |
+
)
|
| 406 |
+
|
| 407 |
+
filt_date_col.change(
|
| 408 |
+
update_date_bounds,
|
| 409 |
+
inputs=[meta_state, filt_date_col],
|
| 410 |
+
outputs=[filt_date_start, filt_date_end],
|
| 411 |
+
)
|
| 412 |
+
|
| 413 |
+
# ---------- Apply filters ----------
|
| 414 |
+
def apply_filters_wrapper(
|
| 415 |
+
df,
|
| 416 |
+
num_col,
|
| 417 |
+
num_min_val,
|
| 418 |
+
num_max_val,
|
| 419 |
+
cat_col,
|
| 420 |
+
cat_vals,
|
| 421 |
+
d_col,
|
| 422 |
+
d_start,
|
| 423 |
+
d_end,
|
| 424 |
+
):
|
| 425 |
+
if df is None:
|
| 426 |
+
return gr.update(value=None, visible=False)
|
| 427 |
+
|
| 428 |
+
numeric_filters = {}
|
| 429 |
+
categorical_filters = {}
|
| 430 |
+
date_filters = {}
|
| 431 |
+
|
| 432 |
+
if num_col and num_min_val is not None and num_max_val is not None:
|
| 433 |
+
numeric_filters[num_col] = [num_min_val, num_max_val]
|
| 434 |
+
|
| 435 |
+
if cat_col and cat_vals:
|
| 436 |
+
categorical_filters[cat_col] = cat_vals
|
| 437 |
+
|
| 438 |
+
if d_col and d_start and d_end:
|
| 439 |
+
date_filters[d_col] = [d_start, d_end]
|
| 440 |
+
|
| 441 |
+
out_df = apply_filters(
|
| 442 |
+
df,
|
| 443 |
+
numeric_filters=numeric_filters or None,
|
| 444 |
+
categorical_filters=categorical_filters or None,
|
| 445 |
+
date_filters=date_filters or None,
|
| 446 |
+
)
|
| 447 |
+
return gr.update(value=out_df.head(50), visible=True)
|
| 448 |
+
|
| 449 |
+
apply_filters_btn.click(
|
| 450 |
+
apply_filters_wrapper,
|
| 451 |
+
inputs=[
|
| 452 |
+
df_state,
|
| 453 |
+
filt_num_col,
|
| 454 |
+
filt_num_min,
|
| 455 |
+
filt_num_max,
|
| 456 |
+
filt_cat_col,
|
| 457 |
+
filt_cat_vals,
|
| 458 |
+
filt_date_col,
|
| 459 |
+
filt_date_start,
|
| 460 |
+
filt_date_end,
|
| 461 |
+
],
|
| 462 |
+
outputs=[filtered_preview],
|
| 463 |
+
)
|
| 464 |
+
|
| 465 |
+
# ---------- Export filtered data ----------
|
| 466 |
+
def export_filtered_data(
|
| 467 |
+
df,
|
| 468 |
+
num_col,
|
| 469 |
+
num_min_val,
|
| 470 |
+
num_max_val,
|
| 471 |
+
cat_col,
|
| 472 |
+
cat_vals,
|
| 473 |
+
d_col,
|
| 474 |
+
d_start,
|
| 475 |
+
d_end,
|
| 476 |
+
):
|
| 477 |
+
if df is None:
|
| 478 |
+
return None
|
| 479 |
+
|
| 480 |
+
numeric_filters = {}
|
| 481 |
+
categorical_filters = {}
|
| 482 |
+
date_filters = {}
|
| 483 |
+
|
| 484 |
+
if num_col and num_min_val is not None and num_max_val is not None:
|
| 485 |
+
numeric_filters[num_col] = [num_min_val, num_max_val]
|
| 486 |
+
|
| 487 |
+
if cat_col and cat_vals:
|
| 488 |
+
categorical_filters[cat_col] = cat_vals
|
| 489 |
+
|
| 490 |
+
if d_col and d_start and d_end:
|
| 491 |
+
date_filters[d_col] = [d_start, d_end]
|
| 492 |
+
|
| 493 |
+
out_df = apply_filters(
|
| 494 |
+
df,
|
| 495 |
+
numeric_filters=numeric_filters or None,
|
| 496 |
+
categorical_filters=categorical_filters or None,
|
| 497 |
+
date_filters=date_filters or None,
|
| 498 |
+
)
|
| 499 |
+
path = "filtered_output.csv"
|
| 500 |
+
out_df.to_csv(path, index=False)
|
| 501 |
+
return path
|
| 502 |
+
|
| 503 |
+
export_filtered_btn.click(
|
| 504 |
+
export_filtered_data,
|
| 505 |
+
inputs=[
|
| 506 |
+
df_state,
|
| 507 |
+
filt_num_col,
|
| 508 |
+
filt_num_min,
|
| 509 |
+
filt_num_max,
|
| 510 |
+
filt_cat_col,
|
| 511 |
+
filt_cat_vals,
|
| 512 |
+
filt_date_col,
|
| 513 |
+
filt_date_start,
|
| 514 |
+
filt_date_end,
|
| 515 |
+
],
|
| 516 |
+
outputs=[filtered_download],
|
| 517 |
+
)
|
| 518 |
+
|
| 519 |
+
# ---------- Visualizations ----------
|
| 520 |
+
def make_chart(df, ctype, x, y, date_c, val, cat, agg, freq_val, col_types):
|
| 521 |
+
if df is None:
|
| 522 |
+
return None, None
|
| 523 |
+
|
| 524 |
+
fig = None
|
| 525 |
+
|
| 526 |
+
if ctype == "Time Series" and date_c and val:
|
| 527 |
+
fig = create_time_series_plot(
|
| 528 |
+
df,
|
| 529 |
+
date_col=date_c,
|
| 530 |
+
value_col=val,
|
| 531 |
+
agg_func=agg,
|
| 532 |
+
freq=freq_val,
|
| 533 |
+
category_col=cat,
|
| 534 |
+
)
|
| 535 |
+
elif ctype == "Histogram" and val:
|
| 536 |
+
fig = create_distribution_plot(df, numeric_col=val, kind="hist")
|
| 537 |
+
elif ctype == "Box Plot" and val:
|
| 538 |
+
fig = create_distribution_plot(df, numeric_col=val, kind="box")
|
| 539 |
+
elif ctype == "Category Bar" and cat:
|
| 540 |
+
fig = create_category_bar_plot(
|
| 541 |
+
df, category_col=cat, value_col=val, agg_func=agg
|
| 542 |
+
)
|
| 543 |
+
elif ctype == "Scatter" and x and y:
|
| 544 |
+
fig = create_scatter_plot(df, x_col=x, y_col=y, category_col=cat)
|
| 545 |
+
elif ctype == "Correlation Heatmap":
|
| 546 |
+
if col_types is None:
|
| 547 |
+
col_types = detect_column_types(df)
|
| 548 |
+
numeric_cols = col_types["numeric"]
|
| 549 |
+
fig = create_correlation_heatmap(df, numeric_cols)
|
| 550 |
+
|
| 551 |
+
if fig is None:
|
| 552 |
+
return None, None
|
| 553 |
+
|
| 554 |
+
png_bytes = figure_to_png_bytes(fig)
|
| 555 |
+
path = "chart_output.png"
|
| 556 |
+
with open(path, "wb") as f:
|
| 557 |
+
f.write(png_bytes)
|
| 558 |
+
|
| 559 |
+
return fig, path
|
| 560 |
+
|
| 561 |
+
viz_btn.click(
|
| 562 |
+
make_chart,
|
| 563 |
+
inputs=[
|
| 564 |
+
df_state,
|
| 565 |
+
chart_type,
|
| 566 |
+
x_col,
|
| 567 |
+
y_col,
|
| 568 |
+
date_col,
|
| 569 |
+
value_col,
|
| 570 |
+
category_col,
|
| 571 |
+
agg_func,
|
| 572 |
+
freq,
|
| 573 |
+
col_types_state,
|
| 574 |
+
],
|
| 575 |
+
outputs=[viz_plot, viz_download],
|
| 576 |
+
)
|
| 577 |
+
|
| 578 |
+
# ---------- Insights ----------
|
| 579 |
+
def get_insights(df):
|
| 580 |
+
if df is None:
|
| 581 |
+
empty_df = gr.update(value=None, visible=False)
|
| 582 |
+
msg = "No data loaded. Please load a dataset in the Data Upload tab first."
|
| 583 |
+
return empty_df, empty_df, empty_df, empty_df, msg
|
| 584 |
+
|
| 585 |
+
# 1) Region ranking
|
| 586 |
+
region_rank = region_ranking(df, value_col="Estimated_Deliveries")
|
| 587 |
+
|
| 588 |
+
# 2) Top / Bottom models (non-overlapping)
|
| 589 |
+
tb_models = top_bottom_groups(df, "Model", "Estimated_Deliveries", top_n=5)
|
| 590 |
+
model_top = tb_models["top"]
|
| 591 |
+
model_bottom = tb_models["bottom"]
|
| 592 |
+
|
| 593 |
+
# 3) Production vs deliveries by model
|
| 594 |
+
model_comp = model_production_vs_delivery(
|
| 595 |
+
df,
|
| 596 |
+
model_col="Model",
|
| 597 |
+
deliveries_col="Estimated_Deliveries",
|
| 598 |
+
prod_col="Production_Units",
|
| 599 |
+
)
|
| 600 |
+
|
| 601 |
+
# 4) Trend summary (quarterly)
|
| 602 |
+
summary_dict, _ = overall_trend_summary(
|
| 603 |
+
df, "Date", "Estimated_Deliveries", freq="Q"
|
| 604 |
+
)
|
| 605 |
+
summary_text = dict_to_text(summary_dict)
|
| 606 |
+
|
| 607 |
+
region_u = gr.update(value=region_rank, visible=True)
|
| 608 |
+
model_top_u = gr.update(value=model_top, visible=True)
|
| 609 |
+
model_bottom_u = gr.update(value=model_bottom, visible=True)
|
| 610 |
+
model_comp_u = gr.update(value=model_comp, visible=True)
|
| 611 |
+
|
| 612 |
+
return region_u, model_top_u, model_bottom_u, model_comp_u, summary_text
|
| 613 |
+
|
| 614 |
+
insights_btn.click(
|
| 615 |
+
get_insights,
|
| 616 |
+
inputs=[df_state],
|
| 617 |
+
outputs=[region_rank_tb, model_top_tb, model_bottom_tb, model_comp_tb, trend_text],
|
| 618 |
+
)
|
| 619 |
+
|
| 620 |
+
return demo
|
| 621 |
+
|
| 622 |
+
|
| 623 |
+
if __name__ == "__main__":
|
| 624 |
+
demo = create_dashboard()
|
| 625 |
+
demo.launch()
|
data/.DS_Store
ADDED
|
Binary file (6.15 kB). View file
|
|
|
data/tesla_clean_full.csv
ADDED
|
The diff for this file is too large to render.
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ons,Source_Type,Charging_Stations
|
| 2 |
+
2023-05-03,2023,5,Europe,Cybertruck,17844,17422,113982.38,61,332,793.88,Interpolated (Month),5581
|
| 3 |
+
2015-02-22,2015,2,Middle East,Model S,5099,5175,113540.95,61,362,272.18,Interpolated (Month),10416
|
| 4 |
+
2019-01-19,2019,1,Asia,Model S,4664,4940,79954.44,123,669,502.56,Estimated (Region),4641
|
| 5 |
+
2021-02-13,2021,2,Asia,Model 3,9810,11604,59600.56,83,455,713.25,Estimated (Region),8362
|
| 6 |
+
2016-12-13,2016,12,North America,Model X,12678,13379,107499.56,123,705,1466.89,Estimated (Region),6279
|
| 7 |
+
2020-04-25,2020,4,Middle East,Model S,4755,5689,106566.17,122,728,592.88,Estimated (Region),11849
|
| 8 |
+
2015-11-03,2015,11,Middle East,Model 3,20540,21043,76237.93,121,678,1992.35,Interpolated (Month),9774
|
| 9 |
+
2020-06-20,2020,6,Europe,Model Y,5025,5797,121896.82,75,437,312.52,Estimated (Region),3841
|
| 10 |
+
2022-04-06,2022,4,Europe,Cybertruck,14328,15888,51091.58,82,484,958.38,Estimated (Region),12228
|
| 11 |
+
2021-03-03,2021,3,North America,Model X,10727,10535,53433.47,73,468,665.35,Interpolated (Month),3315
|
| 12 |
+
2020-11-15,2020,11,Middle East,Model 3,8819,8901,63363.37,74,402,435.43,Interpolated (Month),13471
|
| 13 |
+
2025-05-28,2025,5,Middle East,Model Y,9179,10259,61193.25,60,338,475.27,Interpolated (Month),9563
|
| 14 |
+
2020-10-21,2020,10,North America,Cybertruck,8394,8332,73138.62,75,412,499.29,Estimated (Region),14535
|
| 15 |
+
2020-11-22,2020,11,Middle East,Cybertruck,10666,11530,70143.86,123,706,1207.06,Estimated (Region),4421
|
| 16 |
+
2020-04-21,2020,4,Asia,Model Y,13499,13764,76407.96,82,459,952.7,Official (Quarter),2878
|
| 17 |
+
2025-03-23,2025,3,Asia,Model Y,9284,10989,92574.76,102,544,805.55,Official (Quarter),9059
|
| 18 |
+
2023-11-15,2023,11,Europe,Cybertruck,15112,15102,88570.32,102,543,1400.3,Interpolated (Month),5051
|
| 19 |
+
2020-07-04,2020,7,Europe,Cybertruck,4410,5640,106179.74,100,592,456.91,Official (Quarter),3543
|
| 20 |
+
2017-01-24,2017,1,Europe,Cybertruck,5774,6154,86430.92,121,663,591.2,Interpolated (Month),11876
|
| 21 |
+
2021-01-13,2021,1,Middle East,Model 3,2283,2213,69523.25,119,639,205.99,Official (Quarter),11974
|
| 22 |
+
2019-05-15,2019,5,North America,Model 3,7135,6979,77941.93,123,741,604.54,Official (Quarter),15502
|
| 23 |
+
2016-09-11,2016,9,Middle East,Cybertruck,10374,12772,109561.43,122,635,973.86,Interpolated (Month),16590
|
| 24 |
+
2020-01-06,2020,1,Middle East,Model X,18106,21563,103466.72,59,346,933.59,Interpolated (Month),10150
|
| 25 |
+
2025-09-26,2025,9,Asia,Cybertruck,7895,9997,92176.79,120,670,956.64,Official (Quarter),8214
|
| 26 |
+
2022-04-22,2022,4,Asia,Cybertruck,10439,11876,70539.88,103,623,883.82,Estimated (Region),14816
|
| 27 |
+
2025-03-19,2025,3,North America,Model Y,10452,8994,109301.06,100,580,760.44,Estimated (Region),5000
|
| 28 |
+
2016-12-12,2016,12,Asia,Model Y,8815,9205,119946.46,61,334,401.51,Estimated (Region),13434
|
| 29 |
+
2022-05-24,2022,5,Europe,Model 3,12190,15286,57694.28,121,690,1353.9,Official (Quarter),11405
|
| 30 |
+
2017-06-16,2017,6,Asia,Model S,14834,15005,96177.82,59,366,807.25,Interpolated (Month),4306
|
| 31 |
+
2023-11-13,2023,11,Asia,Cybertruck,7951,9739,66195.66,61,339,456.65,Official (Quarter),10656
|
| 32 |
+
2016-10-13,2016,10,Middle East,Cybertruck,6714,8044,62235.68,58,336,345.86,Estimated (Region),7468
|
| 33 |
+
2024-01-07,2024,1,North America,Model S,12731,14821,59722.07,99,576,924.59,Estimated (Region),14356
|
| 34 |
+
2020-09-03,2020,9,North America,Cybertruck,12986,13024,80667.2,77,426,810.65,Estimated (Region),11313
|
| 35 |
+
2023-05-16,2023,5,North America,Model Y,14689,14672,52348.43,76,441,902.19,Official (Quarter),10938
|
| 36 |
+
2024-01-25,2024,1,Asia,Model 3,14160,15133,76534.12,82,468,919.39,Interpolated (Month),7418
|
| 37 |
+
2015-03-02,2015,3,North America,Model 3,6941,6568,75765.07,83,472,467.27,Estimated (Region),5587
|
| 38 |
+
2023-03-25,2023,3,Europe,Cybertruck,7553,8493,93454.88,60,332,436.57,Estimated (Region),10951
|
| 39 |
+
2019-08-24,2019,8,Middle East,Model X,8307,8359,87697.94,75,408,523.23,Interpolated (Month),8239
|
| 40 |
+
2017-12-08,2017,12,Europe,Cybertruck,8843,7698,111405.6,61,313,372.78,Estimated (Region),11719
|
| 41 |
+
2023-06-18,2023,6,Europe,Cybertruck,13345,14524,56575.92,118,691,1583.6,Interpolated (Month),5877
|
| 42 |
+
2022-07-05,2022,7,Europe,Cybertruck,7643,7887,68508.62,82,477,595.27,Interpolated (Month),12277
|
| 43 |
+
2019-04-22,2019,4,Middle East,Model S,10235,10113,89778.6,60,358,483.32,Estimated (Region),6215
|
| 44 |
+
2023-01-20,2023,1,Asia,Cybertruck,7000,7947,102520.4,79,474,535.52,Interpolated (Month),10709
|
| 45 |
+
2017-08-10,2017,8,Middle East,Model S,13563,13859,108450.36,59,365,664.31,Estimated (Region),9313
|
| 46 |
+
2025-01-02,2025,1,Asia,Model S,12772,14076,110737.96,77,431,776.96,Interpolated (Month),4898
|
| 47 |
+
2018-12-28,2018,12,Asia,Model Y,12711,13936,103664.07,83,487,902.61,Interpolated (Month),10336
|
| 48 |
+
2024-05-13,2024,5,Asia,Model Y,13084,13495,116830.4,97,567,1118.81,Estimated (Region),13928
|
| 49 |
+
2021-02-26,2021,2,North America,Model 3,6640,6531,92194.37,116,697,687.32,Official (Quarter),9926
|
| 50 |
+
2025-09-19,2025,9,Asia,Model 3,14541,14359,95912.49,75,453,875.31,Estimated (Region),8505
|
| 51 |
+
2025-11-22,2025,11,Europe,Model Y,8322,9567,99065.26,77,427,498.42,Interpolated (Month),6727
|
| 52 |
+
2024-09-22,2024,9,Middle East,Model S,10647,11508,78053.44,60,361,629.28,Interpolated (Month),9920
|
| 53 |
+
2016-09-06,2016,9,Europe,Model S,19901,21957,110880.37,103,622,1795.42,Estimated (Region),10036
|
| 54 |
+
2024-02-11,2024,2,Middle East,Model Y,12703,12014,101129.07,60,338,668.39,Estimated (Region),12025
|
| 55 |
+
2015-03-14,2015,3,Asia,Model Y,9519,11416,52338.2,76,443,705.84,Interpolated (Month),6791
|
| 56 |
+
2015-04-14,2015,4,Middle East,Model X,12775,12974,105886.78,97,595,992.74,Interpolated (Month),13355
|
| 57 |
+
2018-07-02,2018,7,Asia,Cybertruck,8960,10152,73098.55,61,337,444.99,Estimated (Region),9327
|
| 58 |
+
2025-03-16,2025,3,Middle East,Model S,12276,11333,82159.52,119,703,999.23,Official (Quarter),11889
|
| 59 |
+
2017-04-05,2017,4,Middle East,Model Y,6698,7898,98045.58,76,401,495.06,Estimated (Region),9421
|
| 60 |
+
2018-08-21,2018,8,Asia,Model S,18458,22726,99381.69,59,364,929.13,Official (Quarter),14725
|
| 61 |
+
2025-05-20,2025,5,Asia,Model S,9673,10568,81711.91,100,597,927.21,Official (Quarter),8542
|
| 62 |
+
2022-12-26,2022,12,Europe,Model Y,8533,9521,52632.41,76,450,613.15,Estimated (Region),3199
|
| 63 |
+
2018-02-21,2018,2,North America,Model Y,11426,12937,114291.57,82,461,865.95,Estimated (Region),10985
|
| 64 |
+
2021-05-11,2021,5,Middle East,Cybertruck,16995,17605,58741.67,121,680,1627.2,Estimated (Region),11504
|
| 65 |
+
2018-05-28,2018,5,Middle East,Cybertruck,6996,8558,90265.17,119,692,719.0,Official (Quarter),12362
|
| 66 |
+
2015-07-12,2015,7,Asia,Model Y,8394,8680,96277.38,99,588,845.98,Official (Quarter),10127
|
| 67 |
+
2021-08-10,2021,8,Asia,Cybertruck,4891,4849,108651.48,62,310,278.33,Official (Quarter),8884
|
| 68 |
+
2024-08-26,2024,8,Europe,Model 3,11281,12549,66036.53,77,446,826.78,Estimated (Region),11691
|
| 69 |
+
2020-03-11,2020,3,Asia,Model S,7180,7322,85681.03,81,459,488.23,Interpolated (Month),6243
|
| 70 |
+
2019-01-03,2019,1,Asia,Model 3,12780,14198,67788.79,76,409,714.94,Official (Quarter),8625
|
| 71 |
+
2015-04-14,2015,4,Middle East,Cybertruck,6533,6218,55263.23,81,470,463.65,Estimated (Region),12141
|
| 72 |
+
2019-04-23,2019,4,North America,Model S,17911,18641,119290.91,117,663,1747.24,Estimated (Region),8945
|
| 73 |
+
2017-08-06,2017,8,Asia,Cybertruck,12579,13024,53941.47,77,432,856.7,Official (Quarter),9875
|
| 74 |
+
2018-08-13,2018,8,Middle East,Model Y,7340,6938,64535.23,58,339,317.82,Official (Quarter),12322
|
| 75 |
+
2024-12-04,2024,12,Middle East,Cybertruck,12749,12647,98622.29,76,465,835.33,Official (Quarter),14413
|
| 76 |
+
2022-10-20,2022,10,North America,Model 3,11158,12237,72875.63,82,480,788.73,Estimated (Region),8082
|
| 77 |
+
2020-09-14,2020,9,Europe,Model 3,6251,6712,105019.95,75,431,423.27,Interpolated (Month),12373
|
| 78 |
+
2017-01-10,2017,1,Asia,Cybertruck,9386,10717,60863.29,76,442,672.83,Estimated (Region),3608
|
| 79 |
+
2021-10-07,2021,10,North America,Model S,13845,16403,83138.64,101,570,1176.37,Interpolated (Month),7932
|
| 80 |
+
2016-01-16,2016,1,Middle East,Model Y,7164,8240,118712.07,74,403,420.55,Official (Quarter),5802
|
| 81 |
+
2016-10-19,2016,10,Asia,Cybertruck,8253,9302,73982.5,101,585,805.77,Official (Quarter),5351
|
| 82 |
+
2023-12-27,2023,12,Middle East,Cybertruck,8713,9854,60226.01,75,410,645.88,Estimated (Region),12190
|
| 83 |
+
2015-12-13,2015,12,Middle East,Model X,15355,16445,87041.82,73,420,989.93,Interpolated (Month),4606
|
| 84 |
+
2016-10-05,2016,10,Asia,Model S,15819,16881,104190.34,82,457,1014.76,Official (Quarter),8942
|
| 85 |
+
2021-02-24,2021,2,Middle East,Model Y,9971,9930,58049.39,84,474,627.07,Estimated (Region),12288
|
| 86 |
+
2022-09-18,2022,9,North America,Model X,14373,14337,96072.64,124,685,1477.9,Interpolated (Month),5063
|
| 87 |
+
2024-07-20,2024,7,Europe,Model 3,1480,1564,88604.55,76,404,110.27,Interpolated (Month),10079
|
| 88 |
+
2020-10-03,2020,10,North America,Model Y,8660,9999,82183.12,98,565,681.43,Official (Quarter),5017
|
| 89 |
+
2017-05-09,2017,5,Europe,Model S,5753,6436,84494.69,83,498,406.61,Estimated (Region),8789
|
| 90 |
+
2020-09-22,2020,9,Asia,Model 3,10280,10518,89161.25,61,337,516.66,Official (Quarter),11436
|
| 91 |
+
2019-08-24,2019,8,Asia,Cybertruck,7995,8903,108445.27,76,423,586.08,Official (Quarter),8752
|
| 92 |
+
2019-09-13,2019,9,Europe,Cybertruck,10108,10195,119866.43,76,440,619.9,Estimated (Region),11451
|
| 93 |
+
2023-01-23,2023,1,Europe,Model X,6723,7650,104730.57,60,335,289.13,Estimated (Region),13809
|
| 94 |
+
2024-03-24,2024,3,Asia,Model S,8724,9411,118534.35,100,558,792.53,Estimated (Region),11715
|
| 95 |
+
2015-12-11,2015,12,Asia,Model 3,12955,13597,60441.0,81,483,981.94,Official (Quarter),13995
|
| 96 |
+
2020-08-26,2020,8,Europe,Model Y,4272,4687,95700.58,79,478,324.71,Interpolated (Month),11814
|
| 97 |
+
2021-11-09,2021,11,North America,Cybertruck,6618,6712,79447.13,101,557,549.56,Official (Quarter),4213
|
| 98 |
+
2023-01-07,2023,1,North America,Model S,10449,10390,90176.85,82,445,681.24,Interpolated (Month),7296
|
| 99 |
+
2023-11-20,2023,11,Asia,Model S,11913,10936,71167.3,61,350,598.99,Interpolated (Month),6370
|
| 100 |
+
2025-08-18,2025,8,Middle East,Cybertruck,10068,11107,52648.93,117,713,1118.68,Interpolated (Month),4225
|
| 101 |
+
2022-06-04,2022,6,Asia,Model X,7208,9293,53326.85,122,688,880.92,Estimated (Region),5571
|
| 102 |
+
2016-03-24,2016,3,North America,Model X,5685,6201,78338.37,62,344,316.04,Estimated (Region),3791
|
| 103 |
+
2025-12-06,2025,12,Europe,Model 3,16259,19404,107925.16,100,576,1588.69,Interpolated (Month),11945
|
| 104 |
+
2019-03-23,2019,3,North America,Model X,10934,12312,56394.71,75,461,704.5,Estimated (Region),8948
|
| 105 |
+
2021-03-01,2021,3,Europe,Model 3,7154,6905,59422.9,101,594,593.18,Official (Quarter),6734
|
| 106 |
+
2021-04-23,2021,4,Europe,Model 3,12279,10867,86974.47,125,722,1207.38,Official (Quarter),7809
|
| 107 |
+
2020-02-23,2020,2,Europe,Model X,9791,9945,58175.95,59,338,496.17,Official (Quarter),9749
|
| 108 |
+
2020-05-22,2020,5,Middle East,Cybertruck,9321,10923,90078.75,120,750,1113.35,Interpolated (Month),14797
|
| 109 |
+
2019-06-19,2019,6,Asia,Model 3,8163,7759,97853.51,74,420,528.08,Estimated (Region),5743
|
| 110 |
+
2021-10-14,2021,10,Europe,Model X,9840,9440,99395.65,59,327,417.47,Official (Quarter),10143
|
| 111 |
+
2016-10-20,2016,10,Middle East,Model X,6564,7416,75846.44,60,340,349.98,Official (Quarter),10603
|
| 112 |
+
2020-03-08,2020,3,Middle East,Model X,8760,9152,96585.66,103,603,757.72,Interpolated (Month),11029
|
| 113 |
+
2020-02-22,2020,2,Asia,Model 3,18347,19042,69732.5,62,357,959.7,Estimated (Region),3808
|
| 114 |
+
2025-06-16,2025,6,Middle East,Model 3,7596,8383,72052.42,76,416,538.05,Interpolated (Month),6564
|
| 115 |
+
2019-09-13,2019,9,North America,Model S,3575,4398,92176.25,119,702,407.58,Interpolated (Month),8584
|
| 116 |
+
2016-12-15,2016,12,Asia,Cybertruck,2845,3100,62640.46,79,452,197.23,Official (Quarter),7438
|
| 117 |
+
2025-10-16,2025,10,Middle East,Model S,7966,8422,72660.04,74,443,541.35,Official (Quarter),9588
|
| 118 |
+
2021-08-02,2021,8,Middle East,Model 3,7129,7929,100957.89,119,714,684.92,Estimated (Region),11367
|
| 119 |
+
2022-11-04,2022,11,North America,Model X,9470,11186,83736.07,79,485,672.04,Official (Quarter),9296
|
| 120 |
+
2018-05-07,2018,5,North America,Model Y,9111,10093,96100.4,84,513,707.97,Estimated (Region),5693
|
| 121 |
+
2016-04-04,2016,4,North America,Model X,12591,12744,54652.99,102,566,1157.95,Official (Quarter),14336
|
| 122 |
+
2019-02-13,2019,2,North America,Model Y,8790,10007,66840.7,105,596,894.54,Estimated (Region),11939
|
| 123 |
+
2023-01-19,2023,1,Asia,Model 3,7083,8061,77626.34,117,696,731.45,Estimated (Region),12753
|
| 124 |
+
2023-05-19,2023,5,Asia,Model X,10263,10447,120089.08,84,478,769.57,Estimated (Region),9754
|
| 125 |
+
2020-02-14,2020,2,Europe,Model Y,13385,15587,86862.17,120,661,1365.23,Official (Quarter),9966
|
| 126 |
+
2019-06-24,2019,6,North America,Cybertruck,12272,13999,57396.35,61,351,562.42,Official (Quarter),13795
|
| 127 |
+
2021-07-16,2021,7,Europe,Cybertruck,5356,6021,114965.99,97,533,418.26,Interpolated (Month),10396
|
| 128 |
+
2019-07-03,2019,7,North America,Model Y,13318,14296,61291.8,103,608,1152.3,Official (Quarter),5095
|
| 129 |
+
2023-12-22,2023,12,North America,Model Y,8687,9767,72949.99,76,420,630.32,Estimated (Region),8517
|
| 130 |
+
2015-03-17,2015,3,Asia,Model X,8275,8455,84472.2,120,668,849.03,Official (Quarter),9772
|
| 131 |
+
2020-01-18,2020,1,Middle East,Cybertruck,6399,7357,69410.77,76,430,466.24,Interpolated (Month),11623
|
| 132 |
+
2015-09-16,2015,9,Middle East,Model X,3196,3579,88943.24,81,485,205.0,Interpolated (Month),5928
|
| 133 |
+
2023-06-16,2023,6,Middle East,Cybertruck,6966,8055,110118.6,119,692,745.53,Official (Quarter),7711
|
| 134 |
+
2018-05-03,2018,5,North America,Model S,5506,5515,93158.51,74,409,375.99,Interpolated (Month),9973
|
| 135 |
+
2020-04-16,2020,4,Asia,Model 3,11198,11857,100604.48,116,663,1252.5,Official (Quarter),4075
|
| 136 |
+
2015-10-23,2015,10,Middle East,Model Y,14775,16981,91901.5,83,511,1117.19,Estimated (Region),10693
|
| 137 |
+
2015-09-09,2015,9,North America,Cybertruck,15519,17566,62720.73,61,325,791.06,Interpolated (Month),14412
|
| 138 |
+
2017-09-17,2017,9,North America,Cybertruck,12538,11657,94229.9,59,327,621.06,Interpolated (Month),10925
|
| 139 |
+
2021-12-01,2021,12,Middle East,Model Y,8266,9511,71340.7,121,739,875.9,Official (Quarter),6484
|
| 140 |
+
2024-11-10,2024,11,Europe,Model S,8755,8055,108495.16,82,500,623.93,Interpolated (Month),11969
|
| 141 |
+
2019-03-13,2019,3,Middle East,Model 3,10212,10876,59567.49,60,332,646.19,Estimated (Region),9061
|
| 142 |
+
2018-07-28,2018,7,North America,Model S,7142,8208,95895.72,81,488,531.0,Official (Quarter),4453
|
| 143 |
+
2024-08-07,2024,8,North America,Model 3,8238,8579,105232.78,98,564,722.88,Estimated (Region),13751
|
| 144 |
+
2022-03-08,2022,3,North America,Model Y,14767,18213,66403.49,77,431,830.53,Official (Quarter),5520
|
| 145 |
+
2018-12-12,2018,12,Asia,Model 3,11153,11002,51874.99,120,758,1127.98,Interpolated (Month),5699
|
| 146 |
+
2021-07-28,2021,7,North America,Model 3,12883,14350,102772.61,125,668,1439.18,Estimated (Region),9638
|
| 147 |
+
2023-11-24,2023,11,Europe,Model S,12282,11876,58292.06,100,582,1149.39,Interpolated (Month),11912
|
| 148 |
+
2022-11-01,2022,11,Europe,Model Y,13423,13763,96515.14,98,586,699.64,Interpolated (Month),14082
|
| 149 |
+
2025-10-07,2025,10,Middle East,Cybertruck,9646,11552,60285.51,77,427,701.32,Estimated (Region),3919
|
| 150 |
+
2016-07-24,2016,7,Europe,Model S,13234,17389,54470.32,101,560,1505.06,Estimated (Region),9418
|
| 151 |
+
2018-02-02,2018,2,Europe,Model X,11412,11172,84108.31,76,408,573.75,Interpolated (Month),6815
|
| 152 |
+
2017-12-24,2017,12,Europe,Model S,14692,12613,49821.85,61,337,776.06,Official (Quarter),9130
|
| 153 |
+
2019-04-08,2019,4,North America,Model 3,7908,8781,78264.21,99,543,525.8,Official (Quarter),14395
|
| 154 |
+
2017-01-26,2017,1,North America,Cybertruck,8935,9999,78540.55,120,660,1091.19,Official (Quarter),3539
|
| 155 |
+
2020-12-09,2020,12,Europe,Model Y,12986,15105,57381.57,120,670,1312.91,Estimated (Region),13254
|
| 156 |
+
2016-08-13,2016,8,Middle East,Model X,6892,7596,89771.16,73,408,360.24,Estimated (Region),12401
|
| 157 |
+
2020-07-19,2020,7,North America,Model X,2110,2178,109607.34,99,528,192.92,Interpolated (Month),3506
|
| 158 |
+
2015-09-04,2015,9,Middle East,Cybertruck,5747,6579,50443.84,123,647,665.96,Official (Quarter),13937
|
| 159 |
+
2016-09-16,2016,9,Asia,Model S,14398,14988,120899.65,60,344,753.85,Interpolated (Month),4684
|
| 160 |
+
2018-08-15,2018,8,North America,Model Y,15166,16518,88811.2,80,478,1130.04,Official (Quarter),10520
|
| 161 |
+
2021-10-22,2021,10,Middle East,Model S,9838,10943,89552.89,58,361,532.09,Official (Quarter),7371
|
| 162 |
+
2021-10-28,2021,10,Asia,Cybertruck,18894,21094,50534.11,103,560,1328.46,Official (Quarter),13719
|
| 163 |
+
2015-10-19,2015,10,Europe,Model X,10602,9378,82221.6,82,492,729.08,Official (Quarter),7984
|
| 164 |
+
2025-02-12,2025,2,North America,Model S,10955,11509,73850.19,59,330,612.93,Official (Quarter),4402
|
| 165 |
+
2015-10-12,2015,10,North America,Model 3,13695,13700,80154.58,119,690,1574.31,Estimated (Region),3457
|
| 166 |
+
2020-08-12,2020,8,Asia,Model Y,8830,9267,54432.74,73,403,463.31,Official (Quarter),5942
|
| 167 |
+
2018-11-23,2018,11,Middle East,Model 3,8774,9636,64336.15,123,716,804.52,Interpolated (Month),5254
|
| 168 |
+
2021-09-09,2021,9,Middle East,Model X,9658,11662,116236.94,74,408,618.06,Estimated (Region),11856
|
| 169 |
+
2025-01-05,2025,1,Europe,Model X,6972,7601,103238.46,123,686,618.16,Estimated (Region),5258
|
| 170 |
+
2025-03-10,2025,3,North America,Model 3,6453,6670,69185.75,60,351,350.69,Interpolated (Month),9622
|
| 171 |
+
2016-05-01,2016,5,Asia,Model 3,398,383,63000.19,123,641,37.17,Interpolated (Month),6135
|
| 172 |
+
2015-12-03,2015,12,North America,Model Y,10096,12100,54215.56,75,454,596.65,Official (Quarter),9270
|
| 173 |
+
2021-03-03,2021,3,Europe,Model S,9222,9693,51982.0,122,725,971.03,Interpolated (Month),4766
|
| 174 |
+
2016-12-22,2016,12,Asia,Model 3,3768,4224,108147.1,122,658,418.19,Interpolated (Month),11803
|
| 175 |
+
2022-05-21,2022,5,North America,Model Y,2242,2247,69566.15,101,559,173.99,Interpolated (Month),6607
|
| 176 |
+
2017-05-20,2017,5,Middle East,Model S,11820,11900,76940.3,60,331,571.37,Official (Quarter),13258
|
| 177 |
+
2019-08-13,2019,8,Middle East,Model Y,7829,9259,66844.8,119,690,733.66,Interpolated (Month),9858
|
| 178 |
+
2022-12-21,2022,12,Europe,Model S,8128,7873,107445.22,125,662,777.62,Interpolated (Month),10610
|
| 179 |
+
2024-08-05,2024,8,Middle East,Cybertruck,7857,8722,90204.17,98,556,630.42,Estimated (Region),6101
|
| 180 |
+
2023-11-26,2023,11,Middle East,Model Y,10931,11495,86871.8,82,459,797.28,Estimated (Region),12291
|
| 181 |
+
2022-03-15,2022,3,North America,Cybertruck,7221,9497,80007.56,82,439,561.99,Interpolated (Month),9951
|
| 182 |
+
2023-08-27,2023,8,Europe,Model S,10064,10530,58162.42,60,350,545.33,Interpolated (Month),11528
|
| 183 |
+
2018-03-05,2018,3,Europe,Cybertruck,12513,13841,66140.67,119,712,1346.82,Estimated (Region),11165
|
| 184 |
+
2020-05-14,2020,5,Europe,Cybertruck,6677,8381,69849.7,75,407,433.58,Official (Quarter),13374
|
| 185 |
+
2021-03-20,2021,3,Middle East,Model 3,7274,8314,78470.79,75,459,505.32,Estimated (Region),5568
|
| 186 |
+
2017-11-14,2017,11,Asia,Cybertruck,6815,7685,74851.17,116,683,737.46,Interpolated (Month),8716
|
| 187 |
+
2019-07-13,2019,7,Europe,Model X,7505,8811,77443.48,60,373,450.86,Official (Quarter),6370
|
| 188 |
+
2015-09-05,2015,9,Europe,Model X,15450,15132,56821.2,98,603,1313.0,Official (Quarter),5351
|
| 189 |
+
2019-10-11,2019,10,Europe,Model Y,10278,11579,56229.53,97,602,855.68,Official (Quarter),13164
|
| 190 |
+
2023-12-07,2023,12,Middle East,Model Y,4662,5457,108829.29,100,555,474.71,Estimated (Region),13762
|
| 191 |
+
2022-02-09,2022,2,North America,Model S,890,962,117433.44,121,626,83.19,Interpolated (Month),13252
|
| 192 |
+
2020-04-20,2020,4,Europe,Model Y,8243,7764,75560.39,121,659,840.0,Official (Quarter),6723
|
| 193 |
+
2018-06-18,2018,6,Middle East,Model 3,16183,19120,87810.55,76,456,1130.3,Interpolated (Month),3372
|
| 194 |
+
2019-05-18,2019,5,Europe,Model S,13556,15570,99970.72,115,708,1497.23,Estimated (Region),6102
|
| 195 |
+
2018-05-11,2018,5,Asia,Model S,6140,6417,77156.95,117,711,606.93,Estimated (Region),9292
|
| 196 |
+
2024-10-27,2024,10,Europe,Model Y,5797,5889,75702.51,104,586,462.38,Official (Quarter),12670
|
| 197 |
+
2025-02-03,2025,2,Europe,Model X,18349,18606,110906.66,98,557,1176.71,Official (Quarter),14706
|
| 198 |
+
2019-02-10,2019,2,Middle East,Cybertruck,17555,19324,97763.42,76,423,1097.8,Interpolated (Month),7271
|
| 199 |
+
2023-11-04,2023,11,Asia,Model Y,12608,11963,72774.82,81,443,861.64,Estimated (Region),11840
|
| 200 |
+
2016-12-10,2016,12,Asia,Model X,10984,11372,112913.54,60,346,635.21,Official (Quarter),5209
|
| 201 |
+
2023-02-27,2023,2,Middle East,Model Y,3093,3130,112020.5,74,436,177.57,Interpolated (Month),4422
|
| 202 |
+
2021-04-11,2021,4,Middle East,Model S,11584,12085,86507.69,76,438,847.97,Estimated (Region),11993
|
| 203 |
+
2018-12-26,2018,12,Asia,Model S,18512,17595,83698.33,120,655,1690.12,Official (Quarter),5092
|
| 204 |
+
2016-10-14,2016,10,North America,Model Y,8558,10366,52265.06,119,701,875.21,Official (Quarter),12963
|
| 205 |
+
2019-06-20,2019,6,Middle East,Model 3,14280,14168,51049.14,98,567,1165.04,Official (Quarter),12661
|
| 206 |
+
2019-01-13,2019,1,Europe,Model Y,1648,1982,51055.52,121,678,151.13,Official (Quarter),10864
|
| 207 |
+
2024-06-08,2024,6,Europe,Model X,8419,8230,105115.34,98,529,750.09,Estimated (Region),3385
|
| 208 |
+
2022-10-22,2022,10,Europe,Model 3,22402,24029,94489.59,61,327,1186.41,Official (Quarter),13395
|
| 209 |
+
2015-05-28,2015,5,Middle East,Model X,7937,9238,113154.3,126,706,906.68,Interpolated (Month),9268
|
| 210 |
+
2024-10-08,2024,10,Europe,Model X,10523,12524,69395.56,103,571,869.78,Estimated (Region),3930
|
| 211 |
+
2018-08-22,2018,8,Asia,Model 3,4146,4401,67414.49,83,503,341.4,Official (Quarter),3545
|
| 212 |
+
2021-05-08,2021,5,Asia,Model Y,9428,8962,60368.28,120,723,997.68,Official (Quarter),11566
|
| 213 |
+
2021-10-21,2021,10,Asia,Model Y,9723,9240,82765.16,96,598,807.77,Interpolated (Month),11404
|
| 214 |
+
2020-12-23,2020,12,Asia,Model 3,9164,11314,118370.74,80,441,778.95,Official (Quarter),4490
|
| 215 |
+
2015-07-13,2015,7,Middle East,Model Y,10698,11025,116080.12,84,465,822.9,Estimated (Region),12480
|
| 216 |
+
2018-08-21,2018,8,Europe,Model 3,17775,20086,95744.36,81,459,1481.61,Estimated (Region),3833
|
| 217 |
+
2021-01-08,2021,1,Asia,Model Y,12708,15915,82031.41,81,497,1071.07,Estimated (Region),11834
|
| 218 |
+
2019-07-03,2019,7,North America,Model X,7762,9999,72305.86,75,447,530.61,Interpolated (Month),3322
|
| 219 |
+
2022-03-03,2022,3,Europe,Model X,579,614,65074.02,73,439,36.81,Official (Quarter),8498
|
| 220 |
+
2025-08-13,2025,8,Europe,Cybertruck,11320,11738,112469.75,59,338,494.09,Interpolated (Month),9686
|
| 221 |
+
2022-08-26,2022,8,Middle East,Model S,11631,10561,99019.1,100,577,911.35,Official (Quarter),5175
|
| 222 |
+
2020-04-04,2020,4,North America,Model X,8182,9058,95215.35,98,569,782.63,Estimated (Region),12382
|
| 223 |
+
2025-04-13,2025,4,North America,Model X,7668,8216,68269.46,99,540,725.65,Official (Quarter),10986
|
| 224 |
+
2021-04-20,2021,4,Asia,Model 3,11957,11014,60615.07,118,696,1243.09,Official (Quarter),10833
|
| 225 |
+
2023-03-06,2023,3,Europe,Model X,7434,7910,91170.45,101,566,540.22,Official (Quarter),10751
|
| 226 |
+
2022-02-21,2022,2,Middle East,Model X,8037,10036,57710.6,119,731,927.76,Estimated (Region),8106
|
| 227 |
+
2021-09-09,2021,9,North America,Model 3,9395,10738,91028.03,75,447,703.87,Estimated (Region),4680
|
| 228 |
+
2024-06-23,2024,6,Asia,Model 3,6548,7347,98580.62,76,421,420.08,Interpolated (Month),6161
|
| 229 |
+
2021-11-17,2021,11,Asia,Model Y,5234,5750,63736.86,100,557,459.4,Interpolated (Month),11336
|
| 230 |
+
2015-09-16,2015,9,North America,Model X,7954,7683,82762.29,82,482,512.9,Official (Quarter),4072
|
| 231 |
+
2022-07-05,2022,7,North America,Model S,8701,9543,67834.65,83,472,650.84,Estimated (Region),14256
|
| 232 |
+
2016-11-13,2016,11,North America,Model S,2885,2806,102101.51,122,684,218.06,Official (Quarter),6576
|
| 233 |
+
2016-06-24,2016,6,Middle East,Model Y,8689,10591,64138.3,100,596,817.35,Estimated (Region),11905
|
| 234 |
+
2017-05-01,2017,5,Asia,Model Y,12460,14082,49111.55,100,568,1314.53,Official (Quarter),3480
|
| 235 |
+
2021-08-22,2021,8,Middle East,Model S,10125,11136,73015.86,118,683,938.06,Estimated (Region),3880
|
| 236 |
+
2022-12-14,2022,12,Asia,Model S,14315,15351,119182.06,118,747,1596.42,Interpolated (Month),12953
|
| 237 |
+
2021-06-21,2021,6,Asia,Model Y,7497,8341,75683.3,83,465,552.29,Interpolated (Month),10980
|
| 238 |
+
2019-03-19,2019,3,Asia,Cybertruck,2100,2058,117689.95,83,451,133.71,Estimated (Region),10081
|
| 239 |
+
2022-07-13,2022,7,Asia,Model X,10677,12244,65202.83,61,347,607.29,Estimated (Region),10530
|
| 240 |
+
2021-07-09,2021,7,Europe,Model Y,14147,14362,88384.39,75,448,1035.11,Estimated (Region),12544
|
| 241 |
+
2019-06-18,2019,6,North America,Model X,6366,7672,51997.75,82,440,465.22,Estimated (Region),12590
|
| 242 |
+
2016-10-04,2016,10,North America,Model 3,15152,14748,91248.46,83,442,1039.06,Official (Quarter),6233
|
| 243 |
+
2021-07-17,2021,7,Asia,Cybertruck,720,832,49153.03,84,463,56.66,Official (Quarter),14282
|
| 244 |
+
2015-11-03,2015,11,Middle East,Cybertruck,11129,13499,112262.74,102,587,1342.17,Interpolated (Month),3116
|
| 245 |
+
2024-05-19,2024,5,Asia,Model X,10801,13722,53456.81,60,360,613.69,Interpolated (Month),13062
|
| 246 |
+
2024-11-18,2024,11,Middle East,Model 3,12099,12053,91258.72,103,571,948.15,Official (Quarter),11587
|
| 247 |
+
2022-01-03,2022,1,Middle East,Cybertruck,7983,7600,109492.41,100,564,579.94,Interpolated (Month),7135
|
| 248 |
+
2016-03-22,2016,3,Europe,Model Y,10816,10232,114823.48,83,450,694.93,Interpolated (Month),4172
|
| 249 |
+
2023-11-12,2023,11,Europe,Model 3,9974,12112,93721.86,101,586,1004.67,Official (Quarter),16071
|
| 250 |
+
2018-08-23,2018,8,Europe,Model Y,14121,15017,91835.58,100,577,1168.33,Official (Quarter),11496
|
| 251 |
+
2025-12-02,2025,12,Asia,Model Y,15172,16506,69133.93,118,695,1285.57,Official (Quarter),14210
|
| 252 |
+
2017-02-06,2017,2,Europe,Model 3,12524,13351,107251.66,76,416,788.77,Official (Quarter),11077
|
| 253 |
+
2022-10-14,2022,10,Europe,Model Y,16106,17226,98623.94,79,479,1171.56,Estimated (Region),9247
|
| 254 |
+
2019-12-06,2019,12,Europe,Cybertruck,15157,15004,107508.01,81,445,1098.5,Interpolated (Month),10068
|
| 255 |
+
2022-04-10,2022,4,Middle East,Cybertruck,5854,6037,81455.86,60,331,282.34,Interpolated (Month),6890
|
| 256 |
+
2016-03-19,2016,3,Asia,Model S,10804,11732,91602.94,119,702,960.89,Estimated (Region),6483
|
| 257 |
+
2016-01-05,2016,1,Europe,Model 3,10636,10551,107823.82,74,429,698.56,Estimated (Region),13746
|
| 258 |
+
2023-10-19,2023,10,Asia,Model X,7673,8109,56881.2,62,363,411.17,Official (Quarter),9860
|
| 259 |
+
2019-06-03,2019,6,Middle East,Model X,10280,11253,79965.19,118,712,999.92,Interpolated (Month),6103
|
| 260 |
+
2022-07-05,2022,7,Asia,Cybertruck,9502,10885,85682.8,99,593,1040.39,Estimated (Region),3926
|
| 261 |
+
2022-10-17,2022,10,Middle East,Cybertruck,7168,7630,103698.04,116,695,761.72,Estimated (Region),2851
|
| 262 |
+
2023-12-23,2023,12,Asia,Model Y,11343,13127,106604.16,98,578,1015.89,Official (Quarter),9082
|
| 263 |
+
2022-04-05,2022,4,Europe,Model X,7048,8105,76592.41,72,415,485.07,Estimated (Region),10681
|
| 264 |
+
2022-10-09,2022,10,North America,Model X,8445,9401,113284.29,101,568,836.25,Interpolated (Month),11153
|
| 265 |
+
2023-10-26,2023,10,Middle East,Model Y,14807,16514,63232.67,106,562,1300.73,Interpolated (Month),14161
|
| 266 |
+
2025-04-28,2025,4,Europe,Model 3,13336,13985,52184.08,81,474,960.8,Interpolated (Month),3349
|
| 267 |
+
2017-12-17,2017,12,North America,Model Y,12335,12312,79876.94,79,492,697.78,Estimated (Region),4436
|
| 268 |
+
2024-06-13,2024,6,North America,Model Y,11762,12871,101492.15,61,340,534.21,Estimated (Region),9023
|
| 269 |
+
2019-07-10,2019,7,Middle East,Cybertruck,12821,14199,114954.32,99,578,1101.0,Interpolated (Month),5093
|
| 270 |
+
2019-07-18,2019,7,Middle East,Model 3,11467,13807,121264.48,103,568,1067.27,Interpolated (Month),11033
|
| 271 |
+
2015-06-17,2015,6,Asia,Model Y,6832,6766,76385.62,99,590,607.2,Interpolated (Month),11677
|
| 272 |
+
2022-03-09,2022,3,North America,Model 3,6535,6811,88929.67,59,361,365.5,Estimated (Region),9134
|
| 273 |
+
2019-01-01,2019,1,Asia,Model Y,10246,10510,76735.5,75,451,783.13,Estimated (Region),5903
|
| 274 |
+
2021-07-05,2021,7,Europe,Model S,2083,1891,81909.7,122,677,218.74,Estimated (Region),10387
|
| 275 |
+
2016-09-27,2016,9,Europe,Model X,15859,16497,111472.71,60,358,690.69,Official (Quarter),5069
|
| 276 |
+
2017-06-12,2017,6,North America,Model 3,6661,6888,66038.32,59,330,323.73,Interpolated (Month),9011
|
| 277 |
+
2022-07-14,2022,7,North America,Model X,9175,11714,119063.33,100,599,801.53,Official (Quarter),13595
|
| 278 |
+
2015-12-14,2015,12,Europe,Model 3,10981,12333,94393.71,58,339,514.99,Official (Quarter),12644
|
| 279 |
+
2015-12-22,2015,12,Middle East,Model 3,12972,12156,53453.29,121,694,1382.84,Estimated (Region),11301
|
| 280 |
+
2021-02-02,2021,2,North America,Model S,4721,5082,101072.67,79,478,244.9,Official (Quarter),7658
|
| 281 |
+
2016-12-03,2016,12,North America,Model Y,9205,9330,75654.02,119,687,1058.85,Interpolated (Month),7397
|
| 282 |
+
2015-06-08,2015,6,Middle East,Model 3,9182,9346,72145.82,102,622,799.53,Estimated (Region),11737
|
| 283 |
+
2015-03-14,2015,3,Middle East,Model 3,1969,2058,67854.54,60,346,93.04,Estimated (Region),3882
|
| 284 |
+
2020-08-19,2020,8,North America,Model Y,12954,13456,89226.02,121,749,1554.02,Interpolated (Month),9414
|
| 285 |
+
2023-03-14,2023,3,Asia,Model S,9594,9591,113050.99,60,357,474.59,Official (Quarter),8694
|
| 286 |
+
2018-01-13,2018,1,Europe,Model S,17894,21244,99602.71,84,457,1346.12,Interpolated (Month),10559
|
| 287 |
+
2019-09-27,2019,9,Europe,Model S,9120,9337,83197.15,102,540,727.92,Estimated (Region),8212
|
| 288 |
+
2025-04-05,2025,4,Europe,Cybertruck,9113,11195,53894.29,83,505,778.45,Official (Quarter),7406
|
| 289 |
+
2025-08-17,2025,8,Asia,Model Y,8376,9543,94003.72,84,465,648.23,Official (Quarter),5511
|
| 290 |
+
2018-10-16,2018,10,Europe,Model S,11569,12855,95652.54,122,737,1138.82,Official (Quarter),4024
|
| 291 |
+
2020-03-14,2020,3,Asia,Model Y,10932,11192,70949.53,81,469,771.06,Official (Quarter),10082
|
| 292 |
+
2018-10-23,2018,10,Middle East,Model 3,12031,11515,55887.98,58,329,631.48,Interpolated (Month),5828
|
| 293 |
+
2024-04-08,2024,4,North America,Model Y,3930,3902,68476.81,76,443,259.61,Interpolated (Month),8579
|
| 294 |
+
2016-07-27,2016,7,Europe,Model X,15835,17301,55121.93,83,462,1097.43,Interpolated (Month),6917
|
| 295 |
+
2024-10-10,2024,10,Europe,Cybertruck,11353,12071,76765.16,61,339,698.21,Official (Quarter),6042
|
| 296 |
+
2016-03-16,2016,3,North America,Model 3,15659,16497,81632.04,98,581,1356.7,Estimated (Region),11959
|
| 297 |
+
2022-05-15,2022,5,Middle East,Model S,8579,9422,65638.44,59,331,467.14,Estimated (Region),12226
|
| 298 |
+
2015-11-24,2015,11,Middle East,Model S,7216,7883,54559.31,83,466,521.81,Interpolated (Month),8899
|
| 299 |
+
2022-02-13,2022,2,North America,Model 3,6890,7244,116764.69,75,420,479.26,Estimated (Region),9311
|
| 300 |
+
2020-08-08,2020,8,Asia,Cybertruck,8548,10873,110814.29,79,467,609.84,Official (Quarter),5707
|
| 301 |
+
2023-02-01,2023,2,Middle East,Cybertruck,4911,5452,59474.48,76,430,314.14,Interpolated (Month),4997
|
| 302 |
+
2025-05-11,2025,5,Europe,Model Y,7365,7652,102131.77,72,455,427.0,Interpolated (Month),10602
|
| 303 |
+
2018-05-24,2018,5,Europe,Model Y,17829,15152,96293.69,80,458,1044.08,Official (Quarter),4974
|
| 304 |
+
2017-02-01,2017,2,Europe,Model S,851,863,81686.64,123,716,83.09,Estimated (Region),14218
|
| 305 |
+
2018-05-26,2018,5,Europe,Model S,6073,6378,92041.46,124,693,627.25,Interpolated (Month),5698
|
| 306 |
+
2015-11-16,2015,11,North America,Model X,8319,9266,101918.79,80,439,647.21,Interpolated (Month),4086
|
| 307 |
+
2020-03-04,2020,3,North America,Model Y,12944,15251,63103.95,99,531,1117.24,Official (Quarter),13662
|
| 308 |
+
2020-02-09,2020,2,North America,Model S,12785,12251,110947.1,75,414,743.56,Interpolated (Month),13222
|
| 309 |
+
2020-08-16,2020,8,Middle East,Model 3,11954,14574,57560.32,124,733,1235.42,Estimated (Region),12567
|
| 310 |
+
2025-12-09,2025,12,North America,Model Y,7806,9073,57702.6,99,568,730.7,Interpolated (Month),5780
|
| 311 |
+
2020-03-04,2020,3,Europe,Model S,8058,7762,70522.4,119,664,958.06,Estimated (Region),14167
|
| 312 |
+
2024-12-19,2024,12,Asia,Model Y,16241,19448,81315.84,85,431,1237.11,Interpolated (Month),13488
|
| 313 |
+
2016-11-19,2016,11,Middle East,Cybertruck,11404,12127,114711.73,81,476,749.77,Estimated (Region),3529
|
| 314 |
+
2024-09-04,2024,9,Europe,Model 3,14777,15937,86100.57,101,587,1395.69,Official (Quarter),9782
|
| 315 |
+
2018-04-08,2018,4,North America,Model X,6021,6430,118817.11,97,585,516.75,Interpolated (Month),8612
|
| 316 |
+
2018-09-07,2018,9,Asia,Model 3,14825,15687,110198.79,75,431,1022.26,Official (Quarter),12618
|
| 317 |
+
2021-07-19,2021,7,Middle East,Model S,11922,12635,74284.53,58,351,698.6,Estimated (Region),12938
|
| 318 |
+
2020-11-21,2020,11,North America,Model Y,9526,9626,75536.41,73,441,593.12,Estimated (Region),10140
|
| 319 |
+
2017-01-21,2017,1,Europe,Model 3,2549,2383,86506.53,102,581,200.96,Interpolated (Month),10586
|
| 320 |
+
2021-04-27,2021,4,Middle East,Model X,12992,13202,51286.32,120,676,1376.1,Estimated (Region),14785
|
| 321 |
+
2024-01-22,2024,1,Middle East,Model X,14737,16038,87464.04,99,561,1246.13,Official (Quarter),8128
|
| 322 |
+
2016-11-09,2016,11,Asia,Model X,14725,17876,113230.57,99,605,1234.56,Interpolated (Month),8600
|
| 323 |
+
2017-06-04,2017,6,North America,Model Y,6087,5959,119657.84,100,564,534.64,Interpolated (Month),4079
|
| 324 |
+
2016-05-18,2016,5,Asia,Model Y,12551,12242,81697.26,82,470,919.84,Interpolated (Month),7107
|
| 325 |
+
2018-06-26,2018,6,Asia,Model 3,16374,15965,91388.22,61,342,780.82,Official (Quarter),5393
|
| 326 |
+
2017-11-28,2017,11,North America,Cybertruck,10328,9491,109030.53,57,326,484.22,Interpolated (Month),13016
|
| 327 |
+
2020-06-07,2020,6,Middle East,Model X,14638,15747,65308.43,118,722,1391.43,Interpolated (Month),14691
|
| 328 |
+
2019-02-07,2019,2,Europe,Model 3,7921,8703,97867.24,100,561,714.72,Estimated (Region),9413
|
| 329 |
+
2024-06-02,2024,6,Asia,Model X,16666,19498,59704.35,60,325,803.04,Estimated (Region),11773
|
| 330 |
+
2019-10-04,2019,10,Middle East,Model 3,3272,3642,86374.88,121,673,300.79,Official (Quarter),12283
|
| 331 |
+
2024-06-16,2024,6,Middle East,Model 3,13315,12310,71074.72,82,467,1082.54,Interpolated (Month),10654
|
| 332 |
+
2016-01-16,2016,1,North America,Model Y,5211,5073,85296.97,60,328,277.2,Interpolated (Month),7041
|
| 333 |
+
2015-05-11,2015,5,North America,Model 3,11113,12302,54991.81,119,665,1144.79,Estimated (Region),14876
|
| 334 |
+
2016-01-09,2016,1,Middle East,Model 3,13953,16241,78247.03,100,562,1294.25,Interpolated (Month),9565
|
| 335 |
+
2023-10-24,2023,10,Asia,Model Y,14604,15872,95925.15,77,438,1046.86,Official (Quarter),5581
|
| 336 |
+
2017-03-13,2017,3,Europe,Model X,18644,19280,96006.62,118,617,1768.03,Official (Quarter),6310
|
| 337 |
+
2020-11-23,2020,11,Middle East,Model S,5963,6381,68529.61,60,369,325.5,Estimated (Region),10692
|
| 338 |
+
2017-09-27,2017,9,Middle East,Model Y,11610,12386,122494.56,75,447,755.87,Estimated (Region),10764
|
| 339 |
+
2024-09-09,2024,9,North America,Model Y,4433,4848,70546.99,124,708,472.55,Interpolated (Month),14825
|
| 340 |
+
2023-03-06,2023,3,Europe,Model 3,7053,7839,67967.97,82,452,542.83,Official (Quarter),13054
|
| 341 |
+
2024-12-27,2024,12,Middle East,Model Y,6196,6295,101812.55,122,674,631.47,Interpolated (Month),11880
|
| 342 |
+
2023-06-18,2023,6,Europe,Model Y,10091,10639,60278.9,61,323,416.43,Estimated (Region),5644
|
| 343 |
+
2022-10-09,2022,10,Europe,Cybertruck,10524,12056,110168.9,82,481,781.65,Estimated (Region),13773
|
| 344 |
+
2019-04-18,2019,4,Middle East,Model Y,3633,4278,113120.29,119,652,398.06,Official (Quarter),5674
|
| 345 |
+
2021-03-15,2021,3,Europe,Model X,5910,6337,57505.21,75,449,364.24,Official (Quarter),13435
|
| 346 |
+
2025-05-26,2025,5,North America,Cybertruck,6910,7649,98784.6,75,413,453.43,Estimated (Region),3228
|
| 347 |
+
2024-02-08,2024,2,North America,Model 3,7249,8259,77610.28,76,431,511.09,Interpolated (Month),3050
|
| 348 |
+
2017-06-28,2017,6,Asia,Model 3,8612,9349,84989.84,60,330,518.68,Official (Quarter),10448
|
| 349 |
+
2021-01-27,2021,1,North America,Cybertruck,6371,5744,55494.64,75,449,377.01,Interpolated (Month),10879
|
| 350 |
+
2017-07-06,2017,7,North America,Model S,12381,14699,81461.97,117,673,1462.55,Official (Quarter),10239
|
| 351 |
+
2018-04-05,2018,4,Middle East,Model Y,15984,18389,116403.52,98,556,1240.47,Estimated (Region),12598
|
| 352 |
+
2016-10-15,2016,10,North America,Cybertruck,14878,15693,64825.79,86,427,955.54,Official (Quarter),5934
|
| 353 |
+
2022-05-02,2022,5,Europe,Model Y,20544,22215,92162.56,60,346,1188.08,Official (Quarter),14462
|
| 354 |
+
2025-07-09,2025,7,Asia,Model Y,7744,9064,51518.02,118,661,750.71,Interpolated (Month),10517
|
| 355 |
+
2021-08-13,2021,8,Middle East,Model X,10406,12110,82699.84,62,338,567.73,Estimated (Region),14771
|
| 356 |
+
2017-09-28,2017,9,Middle East,Cybertruck,1527,1799,99734.22,75,424,87.61,Official (Quarter),3643
|
| 357 |
+
2019-03-28,2019,3,Asia,Model 3,7535,8287,93949.6,76,402,528.22,Official (Quarter),3383
|
| 358 |
+
2023-12-05,2023,12,Middle East,Model 3,9860,10291,101783.6,60,324,432.64,Interpolated (Month),9535
|
| 359 |
+
2016-09-25,2016,9,Middle East,Model Y,12368,12674,114034.85,75,438,716.71,Estimated (Region),14892
|
| 360 |
+
2017-04-03,2017,4,Asia,Model Y,11089,10770,79338.67,100,583,863.2,Official (Quarter),3636
|
| 361 |
+
2021-04-21,2021,4,Asia,Model X,9259,8652,94392.63,80,490,588.79,Interpolated (Month),5408
|
| 362 |
+
2018-06-24,2018,6,Europe,Model Y,7583,8506,111389.97,75,421,481.79,Interpolated (Month),6951
|
| 363 |
+
2015-02-25,2015,2,Middle East,Cybertruck,7768,8185,66842.79,60,335,375.69,Official (Quarter),6063
|
| 364 |
+
2017-03-07,2017,3,Europe,Model S,5911,5881,114775.58,78,424,406.09,Official (Quarter),3735
|
| 365 |
+
2022-09-26,2022,9,North America,Model Y,12901,12692,88791.45,120,715,1535.03,Official (Quarter),3762
|
| 366 |
+
2025-02-04,2025,2,Asia,Model Y,8211,7245,55290.64,114,725,905.32,Estimated (Region),14997
|
| 367 |
+
2025-06-15,2025,6,Asia,Model S,13052,12607,110883.05,100,586,1038.84,Estimated (Region),5721
|
| 368 |
+
2021-01-14,2021,1,Europe,Model X,8783,8202,49878.0,79,457,633.0,Official (Quarter),5524
|
| 369 |
+
2016-09-09,2016,9,Middle East,Model 3,9134,9927,113126.16,61,338,513.84,Estimated (Region),6406
|
| 370 |
+
2022-04-01,2022,4,Europe,Model 3,6903,7037,108955.43,98,578,569.15,Interpolated (Month),3264
|
| 371 |
+
2015-04-22,2015,4,Europe,Model S,10332,11190,61119.63,83,449,772.69,Estimated (Region),11368
|
| 372 |
+
2025-04-10,2025,4,Asia,Model S,8322,9361,98672.77,118,700,978.2,Interpolated (Month),5660
|
| 373 |
+
2017-11-19,2017,11,Middle East,Model X,9670,9777,83387.35,73,461,633.41,Interpolated (Month),14981
|
| 374 |
+
2019-05-12,2019,5,Europe,Model X,13623,14534,97065.88,74,412,784.25,Interpolated (Month),13077
|
| 375 |
+
2023-09-11,2023,9,North America,Model Y,5533,5730,101443.74,75,417,320.65,Official (Quarter),3887
|
| 376 |
+
2016-08-25,2016,8,Europe,Model S,7889,7836,93806.46,79,487,543.53,Interpolated (Month),14672
|
| 377 |
+
2015-12-03,2015,12,North America,Model S,9488,9717,101858.78,80,437,679.53,Estimated (Region),12170
|
| 378 |
+
2025-06-21,2025,6,North America,Model Y,16334,17110,63338.98,60,338,826.28,Estimated (Region),14276
|
| 379 |
+
2025-09-21,2025,9,Middle East,Cybertruck,6472,7317,65920.69,74,414,493.69,Official (Quarter),8967
|
| 380 |
+
2015-06-11,2015,6,Europe,Model Y,3292,3167,115436.35,60,342,181.7,Official (Quarter),7111
|
| 381 |
+
2017-07-08,2017,7,North America,Model X,7204,8343,91247.0,80,466,609.01,Interpolated (Month),3766
|
| 382 |
+
2022-12-01,2022,12,North America,Model 3,8392,9008,93983.93,101,575,840.4,Estimated (Region),13016
|
| 383 |
+
2022-02-27,2022,2,Asia,Model 3,7370,8110,115656.32,117,679,677.2,Official (Quarter),15280
|
| 384 |
+
2015-09-27,2015,9,Asia,Model X,7942,8637,83607.3,85,482,585.28,Official (Quarter),6240
|
| 385 |
+
2021-10-07,2021,10,Europe,Model S,9340,10401,83153.76,79,470,666.88,Official (Quarter),7375
|
| 386 |
+
2018-11-01,2018,11,North America,Model S,9730,9817,67578.7,80,467,566.86,Official (Quarter),7905
|
| 387 |
+
2016-01-04,2016,1,Middle East,Model S,15201,18222,91892.42,101,556,1363.57,Interpolated (Month),11360
|
| 388 |
+
2024-12-02,2024,12,Asia,Cybertruck,6309,7566,99826.04,85,449,485.04,Official (Quarter),4658
|
| 389 |
+
2020-05-24,2020,5,North America,Model Y,8696,10023,74265.38,101,594,777.42,Estimated (Region),9053
|
| 390 |
+
2021-05-25,2021,5,Asia,Model 3,10312,11994,69960.07,61,332,596.02,Official (Quarter),12083
|
| 391 |
+
2023-08-05,2023,8,Europe,Model Y,10844,12140,65809.08,75,430,725.64,Estimated (Region),6614
|
| 392 |
+
2024-05-21,2024,5,North America,Model Y,13056,14224,92980.84,98,593,1455.07,Official (Quarter),3245
|
| 393 |
+
2020-10-06,2020,10,Europe,Model 3,7982,8315,89444.23,119,666,813.27,Official (Quarter),3605
|
| 394 |
+
2024-02-11,2024,2,Europe,Model Y,9505,9270,113133.94,98,545,804.45,Official (Quarter),13520
|
| 395 |
+
2025-11-17,2025,11,Asia,Model Y,7864,8330,91792.19,117,683,824.53,Estimated (Region),4967
|
| 396 |
+
2016-10-21,2016,10,Middle East,Model S,6522,7171,64961.59,101,553,661.28,Official (Quarter),9547
|
| 397 |
+
2018-03-25,2018,3,Middle East,Model S,11742,13601,49105.75,117,729,1199.32,Official (Quarter),3329
|
| 398 |
+
2020-01-02,2020,1,Asia,Model Y,11464,13503,89287.63,101,577,934.87,Official (Quarter),4850
|
| 399 |
+
2018-04-06,2018,4,Asia,Model 3,7114,8497,70835.41,97,592,689.45,Interpolated (Month),9679
|
| 400 |
+
2019-06-08,2019,6,Asia,Model Y,8897,8310,115131.52,82,468,706.72,Official (Quarter),12193
|
| 401 |
+
2025-06-09,2025,6,Middle East,Model S,9200,9901,62451.71,59,341,516.38,Official (Quarter),8053
|
| 402 |
+
2023-10-28,2023,10,North America,Model S,11332,12228,102591.01,77,417,652.39,Interpolated (Month),7548
|
| 403 |
+
2023-10-22,2023,10,Middle East,Cybertruck,5044,5757,121704.62,60,346,281.66,Estimated (Region),14872
|
| 404 |
+
2025-11-09,2025,11,Middle East,Model 3,4373,4851,67821.42,84,476,332.84,Interpolated (Month),3941
|
| 405 |
+
2021-08-28,2021,8,North America,Model Y,11653,11432,80881.42,81,459,890.06,Interpolated (Month),12758
|
| 406 |
+
2016-12-14,2016,12,Middle East,Model 3,9921,11140,104459.37,60,343,572.32,Estimated (Region),14590
|
| 407 |
+
2020-12-15,2020,12,Middle East,Model S,3906,3525,59244.41,80,463,261.18,Estimated (Region),8945
|
| 408 |
+
2023-05-13,2023,5,Middle East,Cybertruck,11282,12326,86155.28,60,374,715.05,Estimated (Region),12796
|
| 409 |
+
2023-04-05,2023,4,Middle East,Model S,14762,16142,97451.8,60,351,957.56,Estimated (Region),5926
|
| 410 |
+
2024-12-27,2024,12,Asia,Model X,16547,19351,82481.58,99,593,1525.46,Estimated (Region),8042
|
| 411 |
+
2018-04-01,2018,4,Europe,Model 3,9630,10673,54910.74,98,590,932.22,Estimated (Region),6718
|
| 412 |
+
2022-11-05,2022,11,Asia,Model X,7191,7611,98630.87,58,340,448.91,Estimated (Region),11765
|
| 413 |
+
2025-03-07,2025,3,Asia,Model 3,12012,12561,106616.86,95,570,1256.54,Official (Quarter),12736
|
| 414 |
+
2021-05-08,2021,5,North America,Cybertruck,2214,2195,66662.4,98,569,211.98,Interpolated (Month),3640
|
| 415 |
+
2015-06-04,2015,6,Asia,Cybertruck,7089,8036,112187.03,76,403,448.1,Estimated (Region),6293
|
| 416 |
+
2016-04-01,2016,4,North America,Cybertruck,10668,9940,102174.99,79,459,687.26,Official (Quarter),9077
|
| 417 |
+
2017-01-19,2017,1,North America,Model X,12464,13221,61761.42,58,358,712.51,Interpolated (Month),12283
|
| 418 |
+
2018-06-28,2018,6,North America,Model 3,9867,10772,60744.12,78,444,750.69,Estimated (Region),9537
|
| 419 |
+
2021-01-04,2021,1,Europe,Model 3,12020,12722,109717.94,74,420,757.93,Estimated (Region),14113
|
| 420 |
+
2019-07-09,2019,7,Asia,Model X,7690,8035,97345.36,75,413,542.58,Estimated (Region),3866
|
| 421 |
+
2016-02-15,2016,2,Asia,Model 3,11607,11301,51222.2,76,398,727.07,Official (Quarter),10845
|
| 422 |
+
2021-03-26,2021,3,North America,Model Y,13894,16626,80690.41,76,426,858.1,Official (Quarter),15046
|
| 423 |
+
2024-03-20,2024,3,Europe,Model Y,14313,16970,109654.16,116,683,1455.93,Official (Quarter),12007
|
| 424 |
+
2018-05-22,2018,5,Asia,Model 3,16105,15739,113571.16,75,423,952.41,Official (Quarter),4549
|
| 425 |
+
2017-07-17,2017,7,Asia,Model S,9203,10312,84346.86,97,635,967.46,Estimated (Region),12950
|
| 426 |
+
2023-10-12,2023,10,North America,Model X,15917,15606,74337.17,79,450,921.38,Official (Quarter),14786
|
| 427 |
+
2015-09-06,2015,9,North America,Model Y,7724,8734,84531.74,97,590,677.8,Estimated (Region),7864
|
| 428 |
+
2016-05-25,2016,5,Asia,Model S,7202,7772,68227.91,117,685,757.21,Official (Quarter),4654
|
| 429 |
+
2020-01-23,2020,1,Europe,Model X,12310,12946,82529.75,80,453,894.95,Estimated (Region),11969
|
| 430 |
+
2022-12-01,2022,12,North America,Model S,4465,5172,109876.41,80,488,383.98,Official (Quarter),11846
|
| 431 |
+
2025-11-21,2025,11,Middle East,Model X,6214,6895,97106.09,103,549,615.07,Official (Quarter),6224
|
| 432 |
+
2022-07-03,2022,7,Asia,Model 3,10605,11125,64689.08,86,480,749.81,Interpolated (Month),9109
|
| 433 |
+
2017-10-21,2017,10,Asia,Model S,11318,12967,82547.9,74,449,767.1,Estimated (Region),3876
|
| 434 |
+
2018-05-24,2018,5,Middle East,Model S,3149,3050,75515.07,97,563,280.23,Official (Quarter),4137
|
| 435 |
+
2018-03-04,2018,3,Europe,Model S,8920,9778,107520.76,72,457,586.02,Interpolated (Month),4451
|
| 436 |
+
2023-06-13,2023,6,Middle East,Model S,11403,9389,85741.59,75,419,692.82,Interpolated (Month),14161
|
| 437 |
+
2022-09-04,2022,9,Middle East,Model Y,7451,7234,108699.82,81,436,481.93,Estimated (Region),6159
|
| 438 |
+
2016-03-16,2016,3,Middle East,Model 3,5157,5900,73039.48,59,353,269.71,Estimated (Region),7915
|
| 439 |
+
2015-08-26,2015,8,Asia,Model 3,11233,11430,111069.79,100,590,956.14,Interpolated (Month),4750
|
| 440 |
+
2023-09-03,2023,9,Asia,Model 3,11953,13823,77217.9,83,502,943.07,Official (Quarter),10641
|
| 441 |
+
2019-09-12,2019,9,North America,Cybertruck,3477,3797,71886.95,60,354,186.04,Interpolated (Month),10056
|
| 442 |
+
2020-01-28,2020,1,Europe,Model S,15826,18816,75665.4,75,425,1170.46,Estimated (Region),4942
|
| 443 |
+
2017-09-09,2017,9,North America,Model S,5675,5263,76694.42,73,449,459.21,Estimated (Region),8993
|
| 444 |
+
2019-08-04,2019,8,Asia,Model X,8635,10512,89906.55,61,342,428.94,Estimated (Region),8346
|
| 445 |
+
2025-07-14,2025,7,North America,Model X,4610,5023,114608.93,75,426,279.05,Estimated (Region),7842
|
| 446 |
+
2021-12-15,2021,12,Europe,Model S,12909,11478,74895.58,83,474,750.16,Official (Quarter),8466
|
| 447 |
+
2017-05-19,2017,5,Europe,Model X,8379,9237,52019.54,83,496,602.18,Interpolated (Month),13656
|
| 448 |
+
2017-02-09,2017,2,Europe,Model Y,6656,6787,78304.09,97,591,613.23,Official (Quarter),5328
|
| 449 |
+
2023-05-27,2023,5,North America,Cybertruck,4253,4712,54040.53,58,362,233.89,Official (Quarter),8417
|
| 450 |
+
2023-11-15,2023,11,Europe,Model Y,11567,13147,118197.95,59,343,581.75,Interpolated (Month),11119
|
| 451 |
+
2022-02-09,2022,2,Middle East,Model S,4372,4057,104512.08,73,421,282.24,Interpolated (Month),10143
|
| 452 |
+
2017-07-27,2017,7,Europe,Cybertruck,6848,7378,107996.51,83,450,439.42,Interpolated (Month),14533
|
| 453 |
+
2016-01-26,2016,1,Europe,Model S,9392,8704,59345.75,83,502,622.61,Official (Quarter),11543
|
| 454 |
+
2019-07-14,2019,7,Europe,Model Y,6672,7118,69806.92,61,363,329.55,Estimated (Region),6247
|
| 455 |
+
2025-10-01,2025,10,Europe,Model 3,7796,8117,117165.12,76,414,421.35,Official (Quarter),4764
|
| 456 |
+
2024-12-17,2024,12,North America,Cybertruck,11194,13116,61869.38,121,686,1035.59,Estimated (Region),13523
|
| 457 |
+
2021-11-16,2021,11,Middle East,Cybertruck,10392,11372,73105.05,123,716,1070.51,Official (Quarter),11269
|
| 458 |
+
2019-11-05,2019,11,Asia,Model 3,9392,9029,116062.78,101,559,884.36,Official (Quarter),4880
|
| 459 |
+
2016-06-18,2016,6,Europe,Model S,7300,7357,102969.74,120,713,744.3,Official (Quarter),9273
|
| 460 |
+
2024-12-24,2024,12,Asia,Model 3,10949,10188,51026.32,77,425,723.23,Official (Quarter),8223
|
| 461 |
+
2022-10-03,2022,10,Middle East,Model Y,10566,10276,63844.4,100,599,791.77,Estimated (Region),8874
|
| 462 |
+
2015-02-21,2015,2,Europe,Model Y,10298,11372,69484.71,99,574,759.99,Official (Quarter),10911
|
| 463 |
+
2025-01-04,2025,1,Asia,Model 3,16300,16027,68172.18,81,477,1208.81,Official (Quarter),11332
|
| 464 |
+
2018-04-21,2018,4,Asia,Model S,6864,6341,93529.25,122,679,524.97,Official (Quarter),3251
|
| 465 |
+
2015-07-12,2015,7,North America,Cybertruck,4469,4387,60459.58,61,335,244.49,Official (Quarter),4962
|
| 466 |
+
2022-08-01,2022,8,Asia,Cybertruck,13728,12807,77507.56,75,442,748.53,Estimated (Region),12024
|
| 467 |
+
2021-06-28,2021,6,North America,Model 3,14635,14024,66415.65,123,715,1580.96,Interpolated (Month),10996
|
| 468 |
+
2023-04-05,2023,4,Europe,Model Y,11655,13806,98630.14,72,435,818.2,Interpolated (Month),15492
|
| 469 |
+
2020-10-17,2020,10,North America,Model X,12027,11829,90594.83,60,331,635.09,Interpolated (Month),3770
|
| 470 |
+
2024-08-06,2024,8,Middle East,Model 3,3510,5389,94415.29,100,579,457.21,Official (Quarter),8718
|
| 471 |
+
2020-07-27,2020,7,Asia,Model S,9742,12189,104641.54,59,367,464.46,Interpolated (Month),7206
|
| 472 |
+
2018-02-21,2018,2,Europe,Model 3,15136,15952,78265.98,86,476,1143.79,Estimated (Region),6571
|
| 473 |
+
2015-08-23,2015,8,North America,Model S,10314,9497,111971.9,120,681,882.7,Interpolated (Month),9975
|
| 474 |
+
2016-11-13,2016,11,Europe,Cybertruck,9828,10966,49056.49,119,631,1079.56,Estimated (Region),10046
|
| 475 |
+
2022-11-14,2022,11,Asia,Model S,12182,13926,87049.63,120,714,1287.65,Interpolated (Month),4060
|
| 476 |
+
2020-04-18,2020,4,Asia,Cybertruck,4400,4225,53408.85,96,625,367.61,Official (Quarter),5601
|
| 477 |
+
2022-12-22,2022,12,Asia,Model Y,10311,12313,94842.35,98,562,824.36,Official (Quarter),2960
|
| 478 |
+
2019-04-24,2019,4,Europe,Cybertruck,12058,11287,76302.66,122,623,1149.02,Estimated (Region),8758
|
| 479 |
+
2023-09-01,2023,9,Europe,Model S,6917,7315,75186.98,118,726,654.15,Estimated (Region),4810
|
| 480 |
+
2024-05-19,2024,5,North America,Model X,14265,14926,117450.84,98,577,1367.04,Interpolated (Month),9852
|
| 481 |
+
2016-05-04,2016,5,Middle East,Model S,18208,19257,112423.74,62,346,862.8,Interpolated (Month),5985
|
| 482 |
+
2024-05-09,2024,5,Europe,Cybertruck,8818,8690,52906.95,77,437,500.51,Interpolated (Month),13701
|
| 483 |
+
2017-02-24,2017,2,North America,Model X,9835,10670,57899.55,83,487,845.87,Interpolated (Month),10611
|
| 484 |
+
2023-05-08,2023,5,Middle East,Model S,11202,12566,96826.16,81,466,794.87,Estimated (Region),10549
|
| 485 |
+
2021-11-23,2021,11,Middle East,Model X,3090,3343,70324.56,119,685,374.16,Official (Quarter),8711
|
| 486 |
+
2015-08-13,2015,8,Europe,Model Y,6433,7264,108139.32,74,436,493.37,Estimated (Region),7927
|
| 487 |
+
2017-03-07,2017,3,Middle East,Model S,9947,10574,98854.65,74,432,618.31,Estimated (Region),5310
|
| 488 |
+
2018-11-10,2018,11,Asia,Model X,7608,7995,109570.56,80,450,547.34,Interpolated (Month),10510
|
| 489 |
+
2022-03-15,2022,3,Asia,Model Y,6424,6208,106325.75,81,484,454.73,Official (Quarter),10452
|
| 490 |
+
2020-11-22,2020,11,Europe,Model 3,5009,5969,89193.53,80,484,403.12,Interpolated (Month),7280
|
| 491 |
+
2016-06-17,2016,6,Middle East,Model X,11361,11404,69342.16,79,477,858.77,Estimated (Region),15057
|
| 492 |
+
2018-12-27,2018,12,Asia,Cybertruck,14918,14919,112637.4,100,531,1266.19,Interpolated (Month),7428
|
| 493 |
+
2015-11-25,2015,11,Europe,Model X,12841,14570,95387.21,82,489,890.33,Official (Quarter),8617
|
| 494 |
+
2017-03-22,2017,3,Asia,Model 3,12735,14832,116600.68,78,397,799.14,Official (Quarter),6026
|
| 495 |
+
2016-01-17,2016,1,North America,Model S,7781,8329,70668.03,118,692,951.06,Estimated (Region),14283
|
| 496 |
+
2017-05-09,2017,5,Europe,Cybertruck,8125,8969,86149.79,75,431,564.57,Interpolated (Month),12105
|
| 497 |
+
2021-04-12,2021,4,Europe,Model X,9017,8359,52193.4,121,663,819.22,Interpolated (Month),6103
|
| 498 |
+
2020-04-04,2020,4,Middle East,Model 3,5026,5817,70364.15,75,440,318.27,Interpolated (Month),12262
|
| 499 |
+
2020-12-11,2020,12,Europe,Cybertruck,2328,2790,95040.77,83,489,169.92,Estimated (Region),14273
|
| 500 |
+
2025-06-26,2025,6,Asia,Cybertruck,8830,9046,105982.33,83,470,552.18,Estimated (Region),10212
|
| 501 |
+
2023-09-12,2023,9,North America,Model S,4797,5368,63695.36,75,420,272.99,Estimated (Region),3504
|
| 502 |
+
2015-03-04,2015,3,North America,Model S,13514,15610,114519.21,60,351,857.92,Official (Quarter),9544
|
| 503 |
+
2017-09-19,2017,9,Europe,Model Y,10500,10901,112192.04,60,338,545.19,Interpolated (Month),6749
|
| 504 |
+
2017-07-27,2017,7,Middle East,Cybertruck,19028,20029,62500.99,58,365,1003.29,Estimated (Region),7458
|
| 505 |
+
2022-02-25,2022,2,Europe,Model X,6360,6293,96449.21,81,456,358.11,Interpolated (Month),6613
|
| 506 |
+
2024-01-08,2024,1,North America,Model 3,3940,4187,90060.25,81,488,288.66,Official (Quarter),8310
|
| 507 |
+
2021-08-13,2021,8,Middle East,Model Y,12151,14353,88240.72,80,474,907.53,Official (Quarter),5204
|
| 508 |
+
2015-10-15,2015,10,North America,Model Y,7214,7120,78460.7,101,590,598.77,Official (Quarter),6808
|
| 509 |
+
2015-12-07,2015,12,Europe,Model Y,16016,17205,81754.03,77,416,1044.28,Official (Quarter),14469
|
| 510 |
+
2024-04-08,2024,4,Europe,Model X,9503,9220,77270.43,118,685,937.05,Estimated (Region),9987
|
| 511 |
+
2023-01-07,2023,1,Asia,Model Y,16688,16990,54751.01,82,460,961.76,Estimated (Region),7793
|
| 512 |
+
2020-08-28,2020,8,North America,Model 3,9890,10572,81426.88,118,697,1035.32,Interpolated (Month),4888
|
| 513 |
+
2024-03-21,2024,3,North America,Model Y,3465,3528,114017.5,119,688,340.39,Official (Quarter),12555
|
| 514 |
+
2017-12-24,2017,12,Asia,Cybertruck,9860,10661,109938.24,59,345,476.24,Interpolated (Month),9951
|
| 515 |
+
2019-10-23,2019,10,Europe,Model 3,6798,7511,66737.73,83,489,456.99,Estimated (Region),13259
|
| 516 |
+
2015-04-27,2015,4,Europe,Model Y,11319,11461,70665.18,99,611,871.58,Official (Quarter),3456
|
| 517 |
+
2023-07-03,2023,7,Asia,Model Y,15734,15783,71180.08,84,462,1080.48,Estimated (Region),7073
|
| 518 |
+
2018-10-25,2018,10,Asia,Model S,6135,6076,83715.31,60,345,348.04,Estimated (Region),12156
|
| 519 |
+
2018-06-02,2018,6,North America,Model X,12101,13156,56980.23,99,574,1050.08,Estimated (Region),10601
|
| 520 |
+
2022-09-14,2022,9,Middle East,Cybertruck,9163,10131,118220.12,117,653,787.83,Interpolated (Month),10139
|
| 521 |
+
2024-07-17,2024,7,Europe,Model X,10096,10250,113682.33,60,343,535.0,Official (Quarter),5082
|
| 522 |
+
2019-11-11,2019,11,North America,Model Y,8019,8108,111940.73,61,332,416.4,Interpolated (Month),12891
|
| 523 |
+
2022-10-05,2022,10,Middle East,Model 3,8280,9404,90293.35,60,342,473.22,Estimated (Region),14146
|
| 524 |
+
2017-10-06,2017,10,North America,Model Y,8313,8716,92250.97,63,360,449.92,Interpolated (Month),4984
|
| 525 |
+
2023-06-24,2023,6,Middle East,Model X,6596,6642,69546.79,62,361,269.56,Interpolated (Month),11682
|
| 526 |
+
2016-02-09,2016,2,North America,Model Y,14892,16012,54379.6,99,531,1279.08,Estimated (Region),9564
|
| 527 |
+
2025-03-09,2025,3,Asia,Model X,12357,13677,54714.55,119,675,1171.09,Estimated (Region),8275
|
| 528 |
+
2024-10-26,2024,10,North America,Model 3,5628,6158,65647.95,121,705,530.73,Interpolated (Month),13656
|
| 529 |
+
2022-06-05,2022,6,Middle East,Model X,14619,14924,99254.85,81,447,953.12,Official (Quarter),4182
|
| 530 |
+
2024-12-26,2024,12,Europe,Model S,14134,15132,106856.86,61,354,754.32,Interpolated (Month),3681
|
| 531 |
+
2019-12-26,2019,12,Europe,Model S,4806,5087,79827.3,76,451,294.35,Interpolated (Month),11719
|
| 532 |
+
2024-12-17,2024,12,North America,Model 3,9793,10328,56457.51,82,457,687.48,Estimated (Region),10819
|
| 533 |
+
2016-11-05,2016,11,Asia,Cybertruck,13776,15415,60900.91,83,448,1052.5,Estimated (Region),4617
|
| 534 |
+
2017-02-05,2017,2,Europe,Model X,4993,5937,70922.68,85,479,373.77,Official (Quarter),10606
|
| 535 |
+
2015-04-08,2015,4,North America,Model 3,13391,15285,59846.59,120,669,1305.63,Official (Quarter),3514
|
| 536 |
+
2017-03-17,2017,3,Asia,Model S,7860,9551,62700.37,120,708,821.04,Official (Quarter),14443
|
| 537 |
+
2025-04-05,2025,4,Asia,Model 3,8460,9637,92918.97,103,575,810.79,Interpolated (Month),10180
|
| 538 |
+
2024-07-13,2024,7,Asia,Model Y,13771,15249,74916.02,76,422,789.83,Estimated (Region),8175
|
| 539 |
+
2019-10-04,2019,10,North America,Model Y,10271,11492,85892.47,99,533,940.38,Interpolated (Month),10760
|
| 540 |
+
2020-02-16,2020,2,Asia,Model S,4569,4565,69751.87,82,473,302.42,Estimated (Region),11286
|
| 541 |
+
2024-02-01,2024,2,Europe,Model S,13118,13987,87050.98,100,545,1071.37,Official (Quarter),7881
|
| 542 |
+
2020-01-20,2020,1,Asia,Cybertruck,15391,16003,77004.34,60,370,702.48,Interpolated (Month),14793
|
| 543 |
+
2017-01-02,2017,1,Asia,Model S,10449,10858,96496.9,73,412,632.93,Official (Quarter),13253
|
| 544 |
+
2022-03-06,2022,3,Europe,Model 3,12739,12997,99525.6,97,571,1145.42,Estimated (Region),12626
|
| 545 |
+
2016-10-05,2016,10,North America,Model X,8876,9679,91415.28,118,668,899.86,Official (Quarter),6613
|
| 546 |
+
2019-12-24,2019,12,North America,Cybertruck,6589,6591,53606.98,80,434,493.04,Estimated (Region),4813
|
| 547 |
+
2025-01-02,2025,1,Middle East,Cybertruck,3779,4680,64451.32,99,592,380.56,Official (Quarter),6368
|
| 548 |
+
2015-09-13,2015,9,Europe,Model 3,13767,12002,62867.51,76,419,823.12,Interpolated (Month),11171
|
| 549 |
+
2019-03-17,2019,3,Middle East,Model Y,13188,15144,49160.53,120,726,1496.66,Official (Quarter),14191
|
| 550 |
+
2017-03-15,2017,3,Middle East,Cybertruck,8619,8571,97159.53,82,429,460.55,Official (Quarter),6630
|
| 551 |
+
2015-03-20,2015,3,Europe,Model Y,10840,12335,101548.74,98,604,921.18,Official (Quarter),11326
|
| 552 |
+
2017-07-23,2017,7,Middle East,Model 3,7234,7095,66690.11,99,589,697.66,Estimated (Region),11158
|
| 553 |
+
2021-12-12,2021,12,Europe,Model 3,13442,14592,102367.21,76,459,1019.38,Official (Quarter),4544
|
| 554 |
+
2015-03-24,2015,3,Europe,Model X,4036,4404,99779.78,76,432,263.88,Interpolated (Month),4082
|
| 555 |
+
2019-08-09,2019,8,Asia,Model S,13714,14535,77750.52,81,492,983.53,Official (Quarter),3760
|
| 556 |
+
2025-09-28,2025,9,Middle East,Model Y,12554,13594,52249.31,60,342,639.91,Official (Quarter),4731
|
| 557 |
+
2018-03-15,2018,3,Asia,Model 3,12684,12997,69232.81,86,464,803.24,Estimated (Region),15325
|
| 558 |
+
2022-08-21,2022,8,Europe,Model Y,1349,1510,77671.07,60,322,71.7,Interpolated (Month),11766
|
| 559 |
+
2015-02-25,2015,2,Europe,Cybertruck,5540,5240,98446.16,81,443,348.18,Interpolated (Month),11168
|
| 560 |
+
2020-05-23,2020,5,Asia,Model 3,12108,13646,53715.87,82,449,866.34,Estimated (Region),8214
|
| 561 |
+
2022-06-24,2022,6,Europe,Model Y,12501,14512,52478.58,120,660,1521.46,Estimated (Region),8580
|
| 562 |
+
2025-04-16,2025,4,Asia,Model Y,10226,10901,50066.34,100,538,803.38,Interpolated (Month),5721
|
| 563 |
+
2024-02-02,2024,2,Europe,Model 3,5937,7003,81541.32,75,452,343.3,Estimated (Region),5822
|
| 564 |
+
2025-02-14,2025,2,Middle East,Model Y,7578,8180,88685.49,80,444,473.38,Estimated (Region),5279
|
| 565 |
+
2016-07-06,2016,7,Asia,Model 3,12046,12772,105628.26,118,624,1330.77,Estimated (Region),7750
|
| 566 |
+
2023-12-25,2023,12,North America,Cybertruck,11600,12682,63592.02,60,372,645.98,Interpolated (Month),6217
|
| 567 |
+
2025-12-07,2025,12,North America,Model X,6124,7075,68784.74,82,473,465.68,Estimated (Region),9113
|
| 568 |
+
2023-07-07,2023,7,Europe,Model X,6281,7014,95631.42,119,673,610.28,Official (Quarter),7505
|
| 569 |
+
2020-12-07,2020,12,Middle East,Model 3,11399,13455,76556.99,60,342,654.92,Interpolated (Month),7830
|
| 570 |
+
2018-12-18,2018,12,Europe,Model Y,14344,14208,67903.36,75,462,931.34,Estimated (Region),12159
|
| 571 |
+
2024-08-16,2024,8,Middle East,Model Y,13232,14936,106476.83,83,459,902.46,Interpolated (Month),3233
|
| 572 |
+
2019-04-27,2019,4,Asia,Model X,11049,11560,67205.33,82,483,779.57,Estimated (Region),3938
|
| 573 |
+
2018-07-12,2018,7,Asia,Model 3,11966,13376,86004.98,76,441,689.26,Estimated (Region),9476
|
| 574 |
+
2016-01-08,2016,1,Asia,Cybertruck,9053,9697,75800.01,74,439,629.78,Interpolated (Month),3823
|
| 575 |
+
2023-01-02,2023,1,Europe,Model S,12004,13646,51791.76,83,479,919.15,Interpolated (Month),9306
|
| 576 |
+
2022-12-01,2022,12,North America,Cybertruck,4980,5041,70800.54,60,335,245.13,Estimated (Region),9358
|
| 577 |
+
2020-12-11,2020,12,North America,Model 3,15686,16569,77291.49,102,556,1253.86,Estimated (Region),6879
|
| 578 |
+
2020-05-26,2020,5,North America,Cybertruck,14631,13971,117916.67,101,576,1148.18,Official (Quarter),3776
|
| 579 |
+
2016-06-15,2016,6,Middle East,Cybertruck,6636,6989,61888.68,61,341,330.15,Interpolated (Month),13333
|
| 580 |
+
2025-02-26,2025,2,Asia,Model S,7374,7391,53551.06,75,438,515.71,Estimated (Region),3638
|
| 581 |
+
2019-11-03,2019,11,Middle East,Model Y,4982,4795,74873.88,82,460,342.85,Estimated (Region),5814
|
| 582 |
+
2022-06-03,2022,6,Asia,Cybertruck,3086,3569,105027.04,61,346,135.7,Interpolated (Month),12678
|
| 583 |
+
2017-10-24,2017,10,Middle East,Cybertruck,2791,2957,100626.65,99,547,244.19,Estimated (Region),9131
|
| 584 |
+
2018-10-03,2018,10,North America,Model 3,777,815,120313.71,81,465,53.66,Official (Quarter),13870
|
| 585 |
+
2018-04-02,2018,4,Europe,Model Y,10563,11871,112035.01,100,584,1091.08,Interpolated (Month),11994
|
| 586 |
+
2024-09-12,2024,9,Middle East,Cybertruck,5682,5657,117918.64,101,577,501.93,Official (Quarter),14953
|
| 587 |
+
2018-10-26,2018,10,Middle East,Model S,9138,10572,72985.41,59,313,508.64,Interpolated (Month),12977
|
| 588 |
+
2024-01-20,2024,1,Middle East,Model S,14611,14675,95142.61,100,614,1355.19,Estimated (Region),7644
|
| 589 |
+
2024-09-03,2024,9,Europe,Model X,13625,13659,94839.83,100,564,996.61,Estimated (Region),12826
|
| 590 |
+
2025-05-24,2025,5,Europe,Model S,7839,8192,114832.28,78,497,521.82,Interpolated (Month),7975
|
| 591 |
+
2025-01-24,2025,1,North America,Model S,5890,5992,65941.83,119,691,571.3,Estimated (Region),14161
|
| 592 |
+
2024-09-23,2024,9,North America,Model S,10141,11468,119565.7,75,435,627.48,Estimated (Region),8714
|
| 593 |
+
2019-11-26,2019,11,North America,Model S,11890,11451,64867.26,60,356,646.71,Interpolated (Month),8338
|
| 594 |
+
2023-09-07,2023,9,Europe,Model 3,10112,11912,65094.38,84,463,787.5,Interpolated (Month),14393
|
| 595 |
+
2024-06-28,2024,6,Middle East,Cybertruck,8584,9550,94719.1,80,479,627.31,Estimated (Region),5403
|
| 596 |
+
2024-11-09,2024,11,Middle East,Model S,10585,10024,83928.58,81,484,600.98,Estimated (Region),7258
|
| 597 |
+
2021-08-23,2021,8,Asia,Model Y,5637,5414,65860.94,114,703,641.0,Official (Quarter),8319
|
| 598 |
+
2017-09-17,2017,9,Middle East,Model 3,12065,11811,76770.0,74,440,646.79,Estimated (Region),7542
|
| 599 |
+
2021-07-22,2021,7,Asia,Model Y,15238,14151,87780.46,99,591,1578.94,Estimated (Region),11363
|
| 600 |
+
2019-12-18,2019,12,Europe,Model Y,8495,8219,117371.71,59,339,363.67,Interpolated (Month),5179
|
| 601 |
+
2015-07-18,2015,7,Asia,Model X,6638,6755,117627.95,102,549,520.58,Official (Quarter),13499
|
| 602 |
+
2020-07-18,2020,7,North America,Model S,13799,14854,54665.45,102,560,981.01,Estimated (Region),4781
|
| 603 |
+
2018-07-22,2018,7,North America,Model 3,4966,4843,89442.73,100,555,414.9,Estimated (Region),3029
|
| 604 |
+
2016-09-21,2016,9,Europe,Model 3,5991,6446,105829.57,60,341,280.24,Official (Quarter),7612
|
| 605 |
+
2018-11-04,2018,11,Europe,Model 3,7359,8417,62545.05,84,466,457.65,Interpolated (Month),14875
|
| 606 |
+
2017-10-24,2017,10,North America,Model X,6886,7999,93990.61,82,476,429.93,Official (Quarter),11411
|
| 607 |
+
2023-11-16,2023,11,Asia,Model X,14584,17715,110107.09,98,571,1468.99,Official (Quarter),5540
|
| 608 |
+
2017-01-10,2017,1,North America,Model S,5641,6690,67625.15,58,329,325.64,Estimated (Region),14029
|
| 609 |
+
2022-04-15,2022,4,Asia,Model X,11923,12707,116475.32,99,529,1096.58,Interpolated (Month),8156
|
| 610 |
+
2016-06-28,2016,6,Asia,Model S,13255,15532,112433.42,83,518,929.91,Interpolated (Month),6013
|
| 611 |
+
2023-01-25,2023,1,Middle East,Model Y,8091,9212,104680.61,105,588,742.1,Estimated (Region),8194
|
| 612 |
+
2016-03-24,2016,3,North America,Model Y,1387,1559,94844.06,100,588,108.14,Estimated (Region),7840
|
| 613 |
+
2018-01-13,2018,1,Europe,Model Y,2462,2401,55203.5,98,561,201.88,Official (Quarter),8848
|
| 614 |
+
2021-11-22,2021,11,North America,Model S,14941,15460,90142.61,80,462,983.54,Interpolated (Month),12983
|
| 615 |
+
2023-11-11,2023,11,Europe,Model X,10952,12472,55012.44,121,714,1238.37,Interpolated (Month),14094
|
| 616 |
+
2024-01-20,2024,1,North America,Cybertruck,9309,10369,78736.33,116,699,1001.58,Official (Quarter),9136
|
| 617 |
+
2022-04-18,2022,4,Europe,Model Y,15349,16467,51996.57,76,462,1031.79,Estimated (Region),11934
|
| 618 |
+
2015-12-07,2015,12,Asia,Cybertruck,5116,5413,81487.58,102,639,417.67,Official (Quarter),5214
|
| 619 |
+
2025-11-08,2025,11,Asia,Model X,10434,9126,125594.16,101,572,949.3,Interpolated (Month),8805
|
| 620 |
+
2016-11-02,2016,11,Europe,Model Y,5762,5853,80953.45,60,328,274.08,Official (Quarter),9000
|
| 621 |
+
2019-09-04,2019,9,Middle East,Model Y,14602,15904,54408.64,76,435,902.64,Interpolated (Month),13706
|
| 622 |
+
2015-05-13,2015,5,Asia,Model Y,8138,7974,86155.45,100,592,631.26,Interpolated (Month),11916
|
| 623 |
+
2025-01-14,2025,1,Europe,Model S,7393,6996,57925.75,59,358,356.87,Official (Quarter),3722
|
| 624 |
+
2017-08-05,2017,8,Asia,Model 3,8241,8617,76890.25,78,424,584.78,Official (Quarter),4021
|
| 625 |
+
2016-02-12,2016,2,Europe,Model 3,8235,9679,106171.19,74,434,581.17,Official (Quarter),13294
|
| 626 |
+
2025-05-17,2025,5,Europe,Cybertruck,6342,6316,113785.11,61,350,334.55,Estimated (Region),5048
|
| 627 |
+
2016-03-07,2016,3,Middle East,Cybertruck,10477,12068,97097.91,78,488,783.98,Official (Quarter),9760
|
| 628 |
+
2024-06-10,2024,6,Middle East,Model X,6414,6479,110678.2,77,424,513.89,Estimated (Region),14245
|
| 629 |
+
2018-02-11,2018,2,Asia,Model 3,13138,13601,49793.61,84,471,970.55,Interpolated (Month),11232
|
| 630 |
+
2016-09-15,2016,9,North America,Model 3,8737,9032,90800.93,100,564,656.6,Interpolated (Month),13969
|
| 631 |
+
2016-12-11,2016,12,Middle East,Model S,16166,16516,85058.55,61,345,766.06,Estimated (Region),12729
|
| 632 |
+
2018-02-21,2018,2,North America,Model 3,10670,11155,82235.99,83,454,728.8,Estimated (Region),14222
|
| 633 |
+
2019-09-10,2019,9,Middle East,Model X,7655,9002,121938.91,99,570,702.62,Interpolated (Month),12977
|
| 634 |
+
2024-01-13,2024,1,North America,Model X,7274,7708,103393.64,83,479,487.88,Official (Quarter),14913
|
| 635 |
+
2025-10-11,2025,10,Europe,Model Y,8764,9754,99026.12,98,603,778.5,Official (Quarter),8057
|
| 636 |
+
2021-12-06,2021,12,Middle East,Model S,10000,9891,59920.28,74,427,700.44,Interpolated (Month),7778
|
| 637 |
+
2022-11-20,2022,11,Europe,Cybertruck,9424,9109,63544.95,61,338,395.05,Interpolated (Month),8287
|
| 638 |
+
2019-09-07,2019,9,Europe,Model X,6667,7242,114332.97,122,698,650.46,Official (Quarter),7568
|
| 639 |
+
2025-12-09,2025,12,Middle East,Model 3,11353,12410,49681.62,81,449,738.47,Interpolated (Month),10992
|
| 640 |
+
2019-07-23,2019,7,Asia,Model Y,10814,12110,110365.73,74,452,729.52,Estimated (Region),6737
|
| 641 |
+
2016-02-27,2016,2,North America,Model X,4930,5529,59753.15,81,493,410.99,Estimated (Region),8701
|
| 642 |
+
2019-06-19,2019,6,Europe,Model X,13506,15418,95404.05,83,443,1013.01,Estimated (Region),9380
|
| 643 |
+
2023-04-26,2023,4,North America,Model Y,12095,13319,56906.56,59,339,693.34,Interpolated (Month),8912
|
| 644 |
+
2020-08-24,2020,8,Middle East,Model S,13717,15008,115426.45,121,706,1442.98,Interpolated (Month),3856
|
| 645 |
+
2023-09-14,2023,9,North America,Model X,14959,15208,115875.54,83,453,1017.9,Interpolated (Month),14954
|
| 646 |
+
2015-01-22,2015,1,North America,Model X,8012,8424,63887.63,75,442,455.49,Official (Quarter),9537
|
| 647 |
+
2017-07-10,2017,7,Middle East,Model X,5405,5715,53972.05,84,474,369.55,Estimated (Region),5696
|
| 648 |
+
2017-09-13,2017,9,Asia,Model X,5904,5796,76161.73,82,503,446.74,Estimated (Region),9402
|
| 649 |
+
2020-09-15,2020,9,Middle East,Model Y,10108,10979,81329.29,75,438,736.39,Interpolated (Month),12908
|
| 650 |
+
2018-12-27,2018,12,Middle East,Model S,4178,5519,92830.17,98,570,391.69,Estimated (Region),8447
|
| 651 |
+
2018-04-24,2018,4,Asia,Model X,6196,6609,110376.09,77,433,428.99,Estimated (Region),10807
|
| 652 |
+
2024-04-14,2024,4,Middle East,Model X,10288,13058,106553.91,118,714,1131.71,Interpolated (Month),9177
|
| 653 |
+
2019-12-19,2019,12,North America,Model 3,13395,15206,115803.47,60,350,780.19,Estimated (Region),4824
|
| 654 |
+
2020-04-06,2020,4,Middle East,Model X,16521,16596,69861.83,82,450,959.26,Estimated (Region),12544
|
| 655 |
+
2018-06-23,2018,6,Middle East,Model Y,8283,9156,107230.67,117,666,898.09,Interpolated (Month),3857
|
| 656 |
+
2021-02-16,2021,2,Asia,Model X,10951,10906,57858.05,59,327,508.42,Estimated (Region),14316
|
| 657 |
+
2024-10-15,2024,10,North America,Model S,11069,11508,109303.97,77,446,668.15,Interpolated (Month),4183
|
| 658 |
+
2021-12-22,2021,12,Middle East,Cybertruck,12834,14039,81266.68,60,356,561.97,Estimated (Region),8883
|
| 659 |
+
2023-09-18,2023,9,Europe,Model Y,10227,11153,91302.17,73,430,667.57,Interpolated (Month),11770
|
| 660 |
+
2019-12-03,2019,12,Middle East,Cybertruck,4443,4823,81831.61,83,497,364.3,Estimated (Region),6980
|
| 661 |
+
2025-11-09,2025,11,Europe,Model 3,8474,8162,71858.98,60,356,475.16,Interpolated (Month),11608
|
| 662 |
+
2015-11-05,2015,11,North America,Model Y,13979,16377,76483.14,107,515,1375.81,Interpolated (Month),6048
|
| 663 |
+
2017-07-21,2017,7,Asia,Model 3,10179,13038,76962.2,101,569,1132.63,Official (Quarter),8626
|
| 664 |
+
2018-02-01,2018,2,North America,Cybertruck,4788,5585,87858.09,60,361,257.51,Interpolated (Month),8511
|
| 665 |
+
2020-06-06,2020,6,North America,Model S,12443,12340,64172.58,103,554,1170.28,Interpolated (Month),7777
|
| 666 |
+
2016-04-17,2016,4,Asia,Model X,10897,11360,100724.77,79,454,688.43,Interpolated (Month),6491
|
| 667 |
+
2023-01-20,2023,1,North America,Model Y,8680,8371,63318.36,75,469,546.33,Interpolated (Month),11248
|
| 668 |
+
2022-03-15,2022,3,Middle East,Model 3,12739,14398,116922.42,78,418,788.69,Interpolated (Month),10501
|
| 669 |
+
2023-03-25,2023,3,North America,Model 3,10554,11151,79139.76,75,414,520.81,Estimated (Region),13787
|
| 670 |
+
2018-11-26,2018,11,Europe,Model Y,9662,9682,95173.12,116,654,1035.31,Official (Quarter),4886
|
| 671 |
+
2019-12-04,2019,12,Europe,Model 3,8510,8876,61090.46,74,464,530.34,Interpolated (Month),11231
|
| 672 |
+
2016-06-27,2016,6,Asia,Model Y,15400,15329,59858.93,77,416,860.13,Interpolated (Month),12069
|
| 673 |
+
2019-01-18,2019,1,North America,Model Y,5666,5965,92567.97,76,420,318.17,Interpolated (Month),11665
|
| 674 |
+
2018-03-18,2018,3,Asia,Model Y,16832,17397,79602.69,118,707,1735.0,Estimated (Region),9836
|
| 675 |
+
2017-09-03,2017,9,Europe,Model S,6423,7042,102555.64,74,450,468.45,Interpolated (Month),5725
|
| 676 |
+
2024-09-18,2024,9,Asia,Cybertruck,9982,10618,109768.11,81,459,818.82,Interpolated (Month),10623
|
| 677 |
+
2024-03-21,2024,3,Middle East,Cybertruck,13547,15544,129513.36,101,570,1023.67,Estimated (Region),12674
|
| 678 |
+
2021-02-17,2021,2,Europe,Model X,12681,13027,101744.69,84,484,821.12,Interpolated (Month),7354
|
| 679 |
+
2019-07-03,2019,7,Asia,Cybertruck,10516,13649,93512.75,61,341,573.85,Estimated (Region),6235
|
| 680 |
+
2025-10-15,2025,10,Asia,Cybertruck,2816,3310,107998.89,101,523,273.75,Official (Quarter),3104
|
| 681 |
+
2019-11-27,2019,11,Middle East,Cybertruck,10282,10831,117725.77,80,450,756.43,Estimated (Region),12575
|
| 682 |
+
2019-01-21,2019,1,North America,Model 3,12838,13023,88704.24,117,662,1289.93,Estimated (Region),10319
|
| 683 |
+
2020-09-04,2020,9,North America,Model S,6670,8216,60266.84,121,740,719.61,Interpolated (Month),6048
|
| 684 |
+
2015-10-27,2015,10,Middle East,Model S,13141,16557,111333.39,97,568,1158.47,Official (Quarter),13165
|
| 685 |
+
2015-09-27,2015,9,Middle East,Model Y,10252,11566,87074.7,82,464,871.15,Estimated (Region),12970
|
| 686 |
+
2020-09-05,2020,9,Asia,Model Y,8260,9518,79265.94,60,334,460.85,Estimated (Region),13020
|
| 687 |
+
2019-05-23,2019,5,North America,Model X,8398,8617,70286.18,80,435,544.88,Interpolated (Month),9372
|
| 688 |
+
2021-10-12,2021,10,Asia,Model S,3441,3057,75709.46,98,545,210.1,Official (Quarter),6274
|
| 689 |
+
2025-08-17,2025,8,Asia,Model S,11604,11984,101621.24,120,733,1256.84,Estimated (Region),7665
|
| 690 |
+
2019-04-13,2019,4,Middle East,Model X,13639,14668,98142.39,101,597,1361.41,Interpolated (Month),14272
|
| 691 |
+
2017-10-22,2017,10,Europe,Model X,8654,8833,82175.86,123,679,1013.07,Interpolated (Month),10209
|
| 692 |
+
2015-07-28,2015,7,Europe,Model X,6039,7234,112870.01,101,588,503.52,Estimated (Region),6069
|
| 693 |
+
2016-06-23,2016,6,Asia,Cybertruck,7839,8356,112038.49,82,475,554.64,Estimated (Region),9343
|
| 694 |
+
2022-10-27,2022,10,Middle East,Model S,11188,11547,99834.64,59,323,531.67,Estimated (Region),7689
|
| 695 |
+
2019-01-27,2019,1,Europe,Cybertruck,8681,9509,57282.74,73,476,666.05,Estimated (Region),9928
|
| 696 |
+
2019-08-03,2019,8,North America,Model S,10561,11946,51819.12,81,458,809.35,Interpolated (Month),14912
|
| 697 |
+
2016-04-08,2016,4,Europe,Model S,6656,8021,98035.76,83,502,459.85,Estimated (Region),7045
|
| 698 |
+
2017-08-21,2017,8,North America,Model S,11395,12524,58386.22,60,363,592.04,Estimated (Region),4382
|
| 699 |
+
2016-08-17,2016,8,Asia,Model X,7552,7828,74490.58,96,556,516.78,Estimated (Region),9518
|
| 700 |
+
2020-12-02,2020,12,Asia,Cybertruck,15219,15914,89340.19,74,427,890.35,Interpolated (Month),6136
|
| 701 |
+
2025-09-03,2025,9,North America,Model Y,6027,7267,111690.66,123,679,672.75,Estimated (Region),12437
|
| 702 |
+
2022-02-15,2022,2,Europe,Model 3,11412,11529,53077.55,60,341,599.41,Estimated (Region),9814
|
| 703 |
+
2015-09-18,2015,9,North America,Model S,8567,8196,117222.48,117,689,780.19,Official (Quarter),9920
|
| 704 |
+
2016-10-05,2016,10,Europe,Model 3,10605,9858,110029.81,105,631,865.6,Estimated (Region),4434
|
| 705 |
+
2025-07-05,2025,7,Middle East,Cybertruck,15446,15078,91558.59,82,471,1220.1,Official (Quarter),14788
|
| 706 |
+
2023-02-04,2023,2,Europe,Model Y,7008,8111,70140.44,76,447,443.03,Estimated (Region),8947
|
| 707 |
+
2018-10-16,2018,10,Asia,Cybertruck,1670,1714,113302.25,60,337,85.8,Estimated (Region),6368
|
| 708 |
+
2020-04-01,2020,4,Middle East,Cybertruck,13273,14083,105326.16,119,711,1397.52,Interpolated (Month),8264
|
| 709 |
+
2015-10-17,2015,10,Asia,Model Y,3459,4084,113537.17,99,561,319.99,Interpolated (Month),9370
|
| 710 |
+
2025-06-14,2025,6,Middle East,Cybertruck,14530,15083,97549.84,104,578,1286.26,Official (Quarter),12965
|
| 711 |
+
2023-12-14,2023,12,Asia,Cybertruck,12817,13452,86672.71,102,563,988.06,Official (Quarter),3466
|
| 712 |
+
2022-08-20,2022,8,Europe,Model X,5357,5401,75864.44,76,428,344.91,Official (Quarter),7103
|
| 713 |
+
2025-12-15,2025,12,North America,Cybertruck,9577,10044,67081.13,83,476,612.66,Official (Quarter),4086
|
| 714 |
+
2022-02-21,2022,2,Asia,Model S,7140,7246,80407.34,118,689,686.52,Interpolated (Month),8734
|
| 715 |
+
2018-11-22,2018,11,Middle East,Cybertruck,11659,11944,73461.54,77,467,688.35,Interpolated (Month),11441
|
| 716 |
+
2019-02-26,2019,2,North America,Model X,15204,13784,116534.24,74,447,893.48,Official (Quarter),4862
|
| 717 |
+
2023-06-23,2023,6,Europe,Model X,13759,15498,86040.55,101,574,1345.46,Interpolated (Month),3473
|
| 718 |
+
2017-01-15,2017,1,Europe,Model Y,6602,7762,114333.44,73,412,463.08,Official (Quarter),13742
|
| 719 |
+
2018-10-14,2018,10,Europe,Model X,8816,9167,114023.33,115,648,763.83,Estimated (Region),11712
|
| 720 |
+
2021-01-07,2021,1,Middle East,Model S,8428,8954,92457.11,101,548,744.9,Official (Quarter),3423
|
| 721 |
+
2019-05-17,2019,5,Middle East,Model X,11752,13215,81284.85,59,336,703.52,Interpolated (Month),11251
|
| 722 |
+
2024-12-04,2024,12,Europe,Model 3,5738,6674,110526.32,115,656,548.44,Estimated (Region),4626
|
| 723 |
+
2025-07-27,2025,7,North America,Cybertruck,5767,6499,99980.02,61,330,291.4,Interpolated (Month),4225
|
| 724 |
+
2024-08-24,2024,8,North America,Model Y,9448,10657,122091.58,78,409,594.68,Estimated (Region),14129
|
| 725 |
+
2025-01-04,2025,1,Asia,Cybertruck,10153,12242,54786.25,62,329,541.89,Official (Quarter),3911
|
| 726 |
+
2024-04-23,2024,4,Middle East,Cybertruck,10963,11609,53101.11,99,546,813.86,Interpolated (Month),3132
|
| 727 |
+
2015-06-04,2015,6,North America,Model X,10925,11934,105559.82,82,451,892.61,Estimated (Region),14079
|
| 728 |
+
2022-06-21,2022,6,Europe,Model X,14072,16083,89290.3,76,435,927.85,Interpolated (Month),15556
|
| 729 |
+
2016-03-03,2016,3,Asia,Model 3,17344,17038,60324.66,61,331,846.5,Estimated (Region),10786
|
| 730 |
+
2024-08-14,2024,8,Middle East,Model S,8832,9411,91453.44,119,662,855.98,Interpolated (Month),8221
|
| 731 |
+
2018-04-19,2018,4,Europe,Model S,18427,20997,53595.34,100,601,1493.5,Official (Quarter),9773
|
| 732 |
+
2025-01-21,2025,1,North America,Cybertruck,1957,2368,102900.97,121,694,224.14,Official (Quarter),3997
|
| 733 |
+
2025-04-12,2025,4,Europe,Model X,8868,10828,88111.33,101,544,801.53,Estimated (Region),4361
|
| 734 |
+
2018-04-26,2018,4,Middle East,Cybertruck,46,54,69206.08,75,421,3.12,Interpolated (Month),10840
|
| 735 |
+
2024-07-22,2024,7,North America,Model Y,7975,9964,112668.47,120,683,983.19,Official (Quarter),9991
|
| 736 |
+
2021-02-06,2021,2,Europe,Model S,8294,9010,113239.71,84,451,601.77,Interpolated (Month),9367
|
| 737 |
+
2022-10-19,2022,10,Europe,Model X,10985,13509,61472.1,61,325,602.95,Official (Quarter),10240
|
| 738 |
+
2016-07-21,2016,7,Europe,Model 3,16194,19998,110204.16,76,437,1093.84,Estimated (Region),12660
|
| 739 |
+
2021-04-10,2021,4,Europe,Model Y,6559,6865,84046.44,85,490,535.23,Interpolated (Month),11495
|
| 740 |
+
2017-04-21,2017,4,North America,Cybertruck,10723,9618,54309.75,119,674,943.26,Estimated (Region),4879
|
| 741 |
+
2020-10-26,2020,10,Europe,Model Y,2917,3353,113637.55,77,451,215.35,Estimated (Region),4063
|
| 742 |
+
2022-09-23,2022,9,Asia,Model Y,7214,6651,117933.73,121,667,702.52,Interpolated (Month),5435
|
| 743 |
+
2020-12-22,2020,12,Europe,Model S,14662,16315,77220.77,107,590,1223.91,Estimated (Region),4792
|
| 744 |
+
2021-06-18,2021,6,North America,Model X,8250,8540,87199.91,59,339,423.14,Official (Quarter),8855
|
| 745 |
+
2015-11-08,2015,11,Asia,Model X,7208,8084,117790.14,81,501,551.3,Interpolated (Month),12214
|
| 746 |
+
2019-05-23,2019,5,North America,Model S,6220,6328,77381.02,61,355,311.5,Estimated (Region),5641
|
| 747 |
+
2022-11-11,2022,11,Asia,Cybertruck,6216,6341,66995.68,76,432,386.78,Official (Quarter),7758
|
| 748 |
+
2015-07-15,2015,7,Asia,Cybertruck,110,121,114850.44,125,703,12.88,Interpolated (Month),14973
|
| 749 |
+
2016-03-09,2016,3,Asia,Model X,10713,12789,58542.92,118,702,1027.3,Official (Quarter),5793
|
| 750 |
+
2017-05-09,2017,5,North America,Cybertruck,7986,8269,113332.37,61,352,409.36,Estimated (Region),11938
|
| 751 |
+
2021-01-05,2021,1,Middle East,Cybertruck,12904,13669,92243.37,61,362,703.17,Estimated (Region),8852
|
| 752 |
+
2022-01-27,2022,1,Middle East,Model S,12202,13174,112936.64,83,447,972.39,Estimated (Region),10373
|
| 753 |
+
2021-07-05,2021,7,North America,Model X,9894,10670,69615.19,118,666,1059.47,Official (Quarter),11138
|
| 754 |
+
2016-02-03,2016,2,North America,Cybertruck,14045,16066,69168.92,103,616,1392.7,Interpolated (Month),11092
|
| 755 |
+
2023-03-27,2023,3,Middle East,Model 3,10382,10933,102862.33,84,474,730.81,Estimated (Region),11715
|
| 756 |
+
2016-01-16,2016,1,North America,Model 3,292,321,53637.42,83,467,21.02,Interpolated (Month),4508
|
| 757 |
+
2016-07-13,2016,7,Asia,Cybertruck,10577,11014,119661.23,120,657,1054.87,Estimated (Region),8835
|
| 758 |
+
2019-03-21,2019,3,Middle East,Cybertruck,2635,2585,62664.59,60,362,123.09,Estimated (Region),9470
|
| 759 |
+
2025-01-11,2025,1,Middle East,Model 3,12196,12261,73372.22,100,548,911.3,Official (Quarter),7562
|
| 760 |
+
2022-01-04,2022,1,Asia,Model Y,9768,9781,90762.64,83,470,615.86,Estimated (Region),14621
|
| 761 |
+
2017-08-21,2017,8,Europe,Model Y,10456,10536,115136.87,60,350,548.38,Interpolated (Month),10023
|
| 762 |
+
2020-11-05,2020,11,Europe,Model S,14978,16328,76194.7,59,340,818.5,Official (Quarter),3878
|
| 763 |
+
2022-03-16,2022,3,Asia,Model 3,10347,10126,77069.18,59,355,477.51,Interpolated (Month),12767
|
| 764 |
+
2019-01-27,2019,1,Middle East,Cybertruck,7052,7976,110492.84,81,485,564.39,Estimated (Region),8102
|
| 765 |
+
2016-03-27,2016,3,Europe,Model 3,16349,17860,101727.9,100,616,1564.0,Interpolated (Month),3038
|
| 766 |
+
2019-04-11,2019,4,Europe,Model Y,14350,14147,90752.66,120,715,1680.74,Interpolated (Month),10230
|
| 767 |
+
2018-08-22,2018,8,Europe,Model S,14933,14606,62287.41,121,740,1436.27,Official (Quarter),6238
|
| 768 |
+
2023-03-18,2023,3,Middle East,Model X,4270,4691,105877.32,83,502,329.31,Official (Quarter),5443
|
| 769 |
+
2025-06-14,2025,6,Asia,Model Y,7601,7917,101133.66,59,362,472.78,Interpolated (Month),15206
|
| 770 |
+
2016-10-04,2016,10,Asia,Model X,9674,12342,85914.94,77,425,699.42,Interpolated (Month),3754
|
| 771 |
+
2023-05-11,2023,5,North America,Model S,7826,7765,87505.53,119,695,763.76,Interpolated (Month),9068
|
| 772 |
+
2022-04-19,2022,4,Europe,Model S,16294,15693,69899.93,99,587,1352.5,Interpolated (Month),12950
|
| 773 |
+
2023-01-28,2023,1,North America,Cybertruck,5807,6496,82214.86,61,356,332.32,Official (Quarter),4769
|
| 774 |
+
2015-09-01,2015,9,Asia,Model S,12559,10920,57608.28,96,585,991.74,Interpolated (Month),3301
|
| 775 |
+
2015-04-21,2015,4,Europe,Cybertruck,7237,8862,68955.05,74,426,476.79,Official (Quarter),11418
|
| 776 |
+
2022-08-24,2022,8,North America,Cybertruck,3747,4032,103044.02,84,436,282.39,Official (Quarter),5567
|
| 777 |
+
2021-11-27,2021,11,North America,Model 3,10424,10635,96167.95,79,485,652.72,Estimated (Region),6131
|
| 778 |
+
2018-02-12,2018,2,Asia,Model S,14139,16377,81863.26,102,567,1252.81,Official (Quarter),5968
|
| 779 |
+
2020-07-04,2020,7,North America,Model Y,10777,11340,100710.73,77,398,564.89,Interpolated (Month),6144
|
| 780 |
+
2023-09-08,2023,9,Middle East,Model 3,11829,13767,52404.49,119,719,1196.01,Estimated (Region),8354
|
| 781 |
+
2015-12-24,2015,12,Middle East,Cybertruck,18063,15770,106170.28,101,574,1392.27,Interpolated (Month),8493
|
| 782 |
+
2022-04-25,2022,4,North America,Model 3,12315,12497,85206.21,123,711,1320.62,Estimated (Region),9495
|
| 783 |
+
2023-01-18,2023,1,Europe,Model Y,15426,16284,98697.34,74,456,973.46,Interpolated (Month),6115
|
| 784 |
+
2020-07-04,2020,7,Asia,Model 3,4371,4713,86960.63,102,566,354.17,Interpolated (Month),3301
|
| 785 |
+
2021-07-04,2021,7,Asia,Model X,5094,5708,97269.61,118,660,523.06,Official (Quarter),4414
|
| 786 |
+
2025-06-14,2025,6,Asia,Model X,9595,11276,52339.64,74,436,574.57,Official (Quarter),14488
|
| 787 |
+
2018-09-17,2018,9,Europe,Model Y,5200,6324,56720.98,118,633,558.23,Interpolated (Month),11296
|
| 788 |
+
2020-03-01,2020,3,North America,Cybertruck,14603,15146,112982.09,76,420,1033.53,Interpolated (Month),3205
|
| 789 |
+
2020-10-20,2020,10,Middle East,Model X,6871,6894,85484.1,102,580,562.42,Estimated (Region),6349
|
| 790 |
+
2016-07-16,2016,7,Middle East,Model Y,6184,6530,93629.91,60,350,317.29,Interpolated (Month),3917
|
| 791 |
+
2023-08-01,2023,8,North America,Cybertruck,627,649,108975.84,58,347,30.39,Official (Quarter),9955
|
| 792 |
+
2025-08-03,2025,8,Europe,Model X,14308,14380,64768.88,117,734,1190.25,Official (Quarter),11658
|
| 793 |
+
2020-10-13,2020,10,Asia,Model S,9634,10681,94252.53,60,327,511.47,Interpolated (Month),7567
|
| 794 |
+
2016-03-21,2016,3,North America,Model S,8973,10338,57753.62,62,352,570.64,Interpolated (Month),3140
|
| 795 |
+
2017-06-24,2017,6,North America,Model X,6115,6977,111023.72,76,426,407.82,Interpolated (Month),3724
|
| 796 |
+
2021-11-13,2021,11,Middle East,Model 3,10140,9533,82331.12,119,627,999.14,Official (Quarter),11337
|
| 797 |
+
2018-02-09,2018,2,Middle East,Model 3,7823,7576,111573.11,83,492,628.04,Official (Quarter),5125
|
| 798 |
+
2015-05-28,2015,5,North America,Model Y,4724,5051,52310.14,119,696,523.69,Official (Quarter),9577
|
| 799 |
+
2021-06-13,2021,6,Middle East,Cybertruck,6091,5985,76713.28,74,441,432.37,Interpolated (Month),7248
|
| 800 |
+
2020-07-09,2020,7,Middle East,Model Y,9256,8480,117476.71,118,723,793.4,Interpolated (Month),5104
|
| 801 |
+
2018-01-13,2018,1,North America,Model 3,19020,20041,106609.4,77,417,1229.59,Official (Quarter),13506
|
| 802 |
+
2019-05-01,2019,5,Middle East,Cybertruck,9542,11124,60868.17,95,569,1089.94,Interpolated (Month),7450
|
| 803 |
+
2020-10-09,2020,10,Asia,Cybertruck,9378,11734,114478.1,83,447,757.01,Interpolated (Month),9971
|
| 804 |
+
2017-03-15,2017,3,Europe,Model Y,9647,10177,83439.58,59,340,418.1,Interpolated (Month),4999
|
| 805 |
+
2020-09-26,2020,9,North America,Model Y,5986,6352,105202.99,60,348,315.8,Interpolated (Month),7874
|
| 806 |
+
2018-07-21,2018,7,Europe,Cybertruck,4566,4822,104223.36,124,693,415.92,Interpolated (Month),10210
|
| 807 |
+
2024-09-22,2024,9,Asia,Model 3,10787,13159,74092.67,118,669,1311.76,Official (Quarter),14583
|
| 808 |
+
2017-08-16,2017,8,North America,Model 3,13681,16027,61930.77,81,468,908.87,Estimated (Region),5897
|
| 809 |
+
2024-09-04,2024,9,Asia,Model X,9251,9203,102296.06,100,604,746.08,Official (Quarter),6312
|
| 810 |
+
2015-10-11,2015,10,Europe,Cybertruck,8069,7524,54670.19,76,470,482.89,Estimated (Region),4885
|
| 811 |
+
2023-08-28,2023,8,Asia,Cybertruck,12559,13894,78311.25,59,349,614.48,Interpolated (Month),8682
|
| 812 |
+
2021-09-02,2021,9,Europe,Model S,4647,5360,51978.32,73,424,347.66,Estimated (Region),7628
|
| 813 |
+
2024-05-25,2024,5,Middle East,Cybertruck,15039,16678,49268.75,74,443,1018.63,Interpolated (Month),4291
|
| 814 |
+
2018-10-20,2018,10,Asia,Model X,6140,6793,64147.31,103,619,568.09,Estimated (Region),6622
|
| 815 |
+
2022-09-08,2022,9,Asia,Model S,13165,14142,108249.62,60,338,596.85,Estimated (Region),5472
|
| 816 |
+
2023-01-22,2023,1,Europe,Cybertruck,10321,11330,83752.76,61,346,418.02,Estimated (Region),3216
|
| 817 |
+
2024-08-24,2024,8,Asia,Model Y,8063,9933,93612.72,75,420,507.99,Interpolated (Month),4221
|
| 818 |
+
2020-02-02,2020,2,North America,Model 3,11027,11517,71889.5,99,574,992.4,Interpolated (Month),14113
|
| 819 |
+
2017-02-03,2017,2,Middle East,Model 3,9805,10672,75015.11,85,459,759.24,Official (Quarter),6613
|
| 820 |
+
2023-07-19,2023,7,Middle East,Model 3,11345,12872,103494.07,60,337,568.71,Official (Quarter),13044
|
| 821 |
+
2020-04-28,2020,4,Europe,Cybertruck,4079,4309,82265.72,74,415,291.91,Interpolated (Month),12055
|
| 822 |
+
2021-06-01,2021,6,Middle East,Model Y,3559,4181,74617.32,102,564,324.69,Estimated (Region),3677
|
| 823 |
+
2024-03-19,2024,3,Europe,Model 3,14177,12452,72592.28,74,458,900.67,Official (Quarter),12214
|
| 824 |
+
2017-07-04,2017,7,Europe,Model S,2408,2531,80980.61,119,724,222.34,Interpolated (Month),6086
|
| 825 |
+
2025-08-19,2025,8,Middle East,Model 3,13551,15087,119144.05,82,481,1021.94,Official (Quarter),8290
|
| 826 |
+
2019-03-18,2019,3,Asia,Model Y,9683,12216,114317.88,100,597,1095.96,Official (Quarter),10152
|
| 827 |
+
2015-08-03,2015,8,Middle East,Model 3,12630,15335,75366.8,121,707,1205.8,Interpolated (Month),8562
|
| 828 |
+
2022-03-20,2022,3,North America,Model S,8765,9470,69413.94,78,425,516.56,Interpolated (Month),3055
|
| 829 |
+
2016-08-26,2016,8,Asia,Model 3,11724,14629,83275.84,101,614,1326.85,Estimated (Region),8199
|
| 830 |
+
2023-05-25,2023,5,Middle East,Model Y,12061,13434,101264.59,71,426,678.87,Estimated (Region),7079
|
| 831 |
+
2018-01-01,2018,1,Middle East,Model 3,8120,9548,57262.15,121,675,941.71,Official (Quarter),13651
|
| 832 |
+
2019-05-07,2019,5,Asia,Model 3,10516,11025,74007.13,82,447,767.35,Official (Quarter),9265
|
| 833 |
+
2020-03-07,2020,3,Asia,Model 3,5302,6475,88741.99,60,346,282.42,Interpolated (Month),8050
|
| 834 |
+
2025-01-13,2025,1,Europe,Model 3,15087,15483,103860.47,60,350,815.18,Official (Quarter),6002
|
| 835 |
+
2015-02-05,2015,2,Asia,Model X,3904,4267,64235.02,75,438,284.6,Official (Quarter),7455
|
| 836 |
+
2015-08-24,2015,8,North America,Model X,4460,4246,108315.75,60,359,246.48,Estimated (Region),9394
|
| 837 |
+
2022-01-22,2022,1,Asia,Model 3,8719,8693,59513.0,76,434,557.41,Estimated (Region),9339
|
| 838 |
+
2023-12-23,2023,12,Asia,Model S,5755,6337,63677.51,119,712,555.71,Estimated (Region),5326
|
| 839 |
+
2016-05-06,2016,5,Middle East,Model 3,7014,8745,112568.62,59,312,348.51,Official (Quarter),13173
|
| 840 |
+
2024-08-01,2024,8,Europe,Model S,19106,18093,76062.88,64,355,1026.56,Official (Quarter),10152
|
| 841 |
+
2025-07-26,2025,7,Asia,Model X,15548,18622,68246.03,81,477,1007.97,Estimated (Region),6346
|
| 842 |
+
2023-05-09,2023,5,Asia,Model S,9939,12255,79629.79,75,427,671.8,Official (Quarter),9514
|
| 843 |
+
2016-11-19,2016,11,Asia,Model Y,8989,9967,91204.55,80,457,634.2,Official (Quarter),10959
|
| 844 |
+
2025-10-26,2025,10,Europe,Model S,5747,7028,94303.89,60,334,307.83,Official (Quarter),8223
|
| 845 |
+
2021-09-02,2021,9,Asia,Model S,13484,13497,69534.46,80,468,956.86,Official (Quarter),9852
|
| 846 |
+
2018-11-01,2018,11,Middle East,Model S,12963,12855,114726.74,59,346,737.64,Official (Quarter),9417
|
| 847 |
+
2017-09-01,2017,9,Asia,Model S,12051,10665,57638.79,77,476,792.14,Estimated (Region),7152
|
| 848 |
+
2024-10-05,2024,10,Middle East,Cybertruck,10587,13195,91728.64,61,330,562.79,Estimated (Region),10507
|
| 849 |
+
2016-04-02,2016,4,Middle East,Model 3,10263,11008,109205.01,121,723,1192.51,Estimated (Region),12014
|
| 850 |
+
2016-06-23,2016,6,Middle East,Model 3,13496,14968,102469.02,116,680,1330.88,Interpolated (Month),9028
|
| 851 |
+
2017-04-17,2017,4,Europe,Model X,3392,4053,116318.19,85,493,304.91,Estimated (Region),8059
|
| 852 |
+
2021-04-28,2021,4,Middle East,Model 3,8091,8038,82706.15,117,703,903.08,Estimated (Region),3791
|
| 853 |
+
2023-01-23,2023,1,Middle East,Model S,7347,7637,73037.42,62,360,369.45,Interpolated (Month),4425
|
| 854 |
+
2023-09-27,2023,9,North America,Model 3,8964,9654,95168.71,84,486,526.63,Estimated (Region),7515
|
| 855 |
+
2023-11-07,2023,11,North America,Model S,12979,12442,97116.68,61,355,571.17,Estimated (Region),7105
|
| 856 |
+
2016-04-09,2016,4,Europe,Model 3,16296,17206,95515.62,98,559,1100.95,Estimated (Region),12553
|
| 857 |
+
2016-03-24,2016,3,Europe,Model S,8904,10468,77340.63,60,355,466.57,Official (Quarter),10201
|
| 858 |
+
2017-11-07,2017,11,Middle East,Model Y,8155,9245,62856.52,74,424,435.8,Official (Quarter),5174
|
| 859 |
+
2023-01-02,2023,1,North America,Model X,16034,16706,74311.85,120,702,1619.87,Estimated (Region),11367
|
| 860 |
+
2017-08-19,2017,8,Middle East,Cybertruck,14133,15947,95256.45,75,436,906.49,Official (Quarter),5147
|
| 861 |
+
2025-04-23,2025,4,Middle East,Cybertruck,11083,12476,90121.58,72,424,716.47,Official (Quarter),3181
|
| 862 |
+
2023-06-28,2023,6,Asia,Model 3,8129,8105,71573.4,84,473,523.23,Interpolated (Month),14934
|
| 863 |
+
2019-07-26,2019,7,Middle East,Model Y,9324,8961,84165.69,120,688,985.6,Interpolated (Month),6658
|
| 864 |
+
2022-09-04,2022,9,Europe,Model S,10084,11111,83454.03,81,434,671.55,Interpolated (Month),6593
|
| 865 |
+
2022-02-22,2022,2,Middle East,Model Y,14468,16741,103557.52,59,342,723.04,Estimated (Region),11958
|
| 866 |
+
2020-11-24,2020,11,North America,Model X,12471,11762,81199.25,101,565,1059.62,Interpolated (Month),11970
|
| 867 |
+
2023-12-20,2023,12,Middle East,Model S,9539,10622,72515.5,98,552,828.17,Interpolated (Month),4656
|
| 868 |
+
2024-05-23,2024,5,Europe,Model S,9301,9568,75855.94,78,486,662.2,Official (Quarter),14658
|
| 869 |
+
2019-01-24,2019,1,North America,Model X,8796,9879,119794.64,83,487,636.67,Interpolated (Month),14446
|
| 870 |
+
2023-03-13,2023,3,North America,Model S,9021,9856,94723.64,101,573,781.49,Estimated (Region),15196
|
| 871 |
+
2025-10-02,2025,10,Asia,Model X,4950,5332,55044.43,75,434,341.77,Official (Quarter),6407
|
| 872 |
+
2021-01-13,2021,1,North America,Model S,10424,11282,108088.26,59,355,500.36,Estimated (Region),10908
|
| 873 |
+
2021-09-06,2021,9,Middle East,Model 3,9414,10301,73913.94,75,441,753.13,Official (Quarter),5998
|
| 874 |
+
2015-01-04,2015,1,Middle East,Model X,7550,8079,77995.89,73,403,438.3,Official (Quarter),4306
|
| 875 |
+
2018-08-04,2018,8,Middle East,Model X,9711,8968,71109.26,118,685,1024.03,Official (Quarter),10850
|
| 876 |
+
2019-07-20,2019,7,Europe,Model S,3704,3466,104592.1,59,343,178.62,Interpolated (Month),10195
|
| 877 |
+
2018-05-15,2018,5,Europe,Model X,11676,12542,91221.62,122,672,1354.88,Interpolated (Month),12813
|
| 878 |
+
2024-07-16,2024,7,Asia,Model S,6135,7021,101369.35,74,439,439.87,Estimated (Region),8953
|
| 879 |
+
2017-02-21,2017,2,Middle East,Model Y,10474,12666,79549.7,74,422,747.73,Official (Quarter),6189
|
| 880 |
+
2016-09-16,2016,9,Europe,Model Y,13192,14629,67123.03,78,415,779.58,Interpolated (Month),7416
|
| 881 |
+
2020-01-18,2020,1,North America,Model 3,8886,10479,104278.35,60,336,503.13,Interpolated (Month),8083
|
| 882 |
+
2016-04-03,2016,4,Middle East,Model X,10044,10206,66493.21,83,456,750.64,Estimated (Region),7676
|
| 883 |
+
2023-08-24,2023,8,Middle East,Model 3,9932,12059,55728.91,60,352,531.92,Official (Quarter),8735
|
| 884 |
+
2019-03-13,2019,3,North America,Model S,10197,10764,110528.73,81,475,705.82,Interpolated (Month),10601
|
| 885 |
+
2018-09-05,2018,9,Middle East,Cybertruck,9392,12056,64628.03,96,596,813.2,Interpolated (Month),10762
|
| 886 |
+
2019-05-23,2019,5,Asia,Model Y,13105,14050,91417.46,84,514,909.84,Interpolated (Month),9967
|
| 887 |
+
2019-08-21,2019,8,Europe,Cybertruck,12575,16032,84848.35,83,477,1102.2,Estimated (Region),8166
|
| 888 |
+
2016-08-02,2016,8,Asia,Model S,12526,12316,78153.99,120,737,1132.63,Official (Quarter),9766
|
| 889 |
+
2024-07-06,2024,7,Middle East,Model 3,9770,9618,90448.06,75,435,554.87,Interpolated (Month),10238
|
| 890 |
+
2022-07-01,2022,7,Middle East,Model X,8788,8760,91863.29,76,441,594.98,Official (Quarter),7383
|
| 891 |
+
2018-09-08,2018,9,Middle East,Model 3,10810,11664,74429.31,58,348,626.3,Official (Quarter),9564
|
| 892 |
+
2019-04-03,2019,4,Europe,Model S,12515,12735,100714.97,99,583,1218.6,Interpolated (Month),7319
|
| 893 |
+
2019-09-20,2019,9,Asia,Model Y,7348,7602,63460.03,98,549,572.75,Estimated (Region),12617
|
| 894 |
+
2018-07-15,2018,7,North America,Model Y,14297,17627,61302.8,104,544,1304.84,Estimated (Region),13846
|
| 895 |
+
2024-11-28,2024,11,North America,Model X,9455,9467,50413.6,83,472,633.42,Estimated (Region),14825
|
| 896 |
+
2018-06-21,2018,6,North America,Model Y,16247,15751,102929.76,72,433,1021.59,Estimated (Region),13771
|
| 897 |
+
2016-02-18,2016,2,Asia,Model X,12797,14622,57634.15,116,700,1121.8,Interpolated (Month),7882
|
| 898 |
+
2019-05-15,2019,5,North America,Cybertruck,5539,5346,98279.37,75,408,357.87,Official (Quarter),7170
|
| 899 |
+
2024-07-02,2024,7,Europe,Cybertruck,15401,16115,115386.82,99,586,1378.2,Interpolated (Month),4588
|
| 900 |
+
2018-12-02,2018,12,Europe,Cybertruck,7108,7537,79230.78,117,708,680.03,Estimated (Region),13598
|
| 901 |
+
2016-09-18,2016,9,North America,Cybertruck,15653,16116,113079.1,78,430,889.46,Interpolated (Month),11736
|
| 902 |
+
2015-12-01,2015,12,Asia,Model S,5067,6225,98586.55,83,467,392.93,Official (Quarter),6030
|
| 903 |
+
2016-06-02,2016,6,North America,Model X,5720,5506,60093.4,101,571,537.85,Official (Quarter),12220
|
| 904 |
+
2020-06-07,2020,6,Europe,Model S,1277,1425,102589.5,74,418,72.31,Interpolated (Month),6774
|
| 905 |
+
2024-07-25,2024,7,Middle East,Cybertruck,10736,12912,68187.65,83,514,902.13,Estimated (Region),13251
|
| 906 |
+
2015-01-13,2015,1,Europe,Model X,8875,8605,115105.33,81,477,712.17,Official (Quarter),10862
|
| 907 |
+
2022-03-20,2022,3,Asia,Model X,15669,13837,70341.1,60,321,826.68,Interpolated (Month),13177
|
| 908 |
+
2023-09-12,2023,9,Asia,Model Y,3386,3730,114657.68,101,577,274.98,Estimated (Region),13660
|
| 909 |
+
2016-04-05,2016,4,North America,Model 3,4596,5271,74663.0,79,455,303.68,Interpolated (Month),10797
|
| 910 |
+
2022-01-11,2022,1,Europe,Model X,14539,17311,56988.35,77,413,982.85,Estimated (Region),6964
|
| 911 |
+
2016-04-03,2016,4,Asia,Model Y,9075,8803,72786.97,75,435,581.24,Interpolated (Month),13363
|
| 912 |
+
2016-10-22,2016,10,Europe,Model S,18086,19514,49711.3,123,664,1556.97,Estimated (Region),14864
|
| 913 |
+
2021-11-06,2021,11,Asia,Model 3,9680,9854,58634.56,73,392,633.86,Estimated (Region),12224
|
| 914 |
+
2015-06-11,2015,6,Europe,Cybertruck,10003,10870,64711.5,80,443,665.28,Estimated (Region),4633
|
| 915 |
+
2021-11-28,2021,11,North America,Model Y,7418,8532,93914.64,80,488,685.15,Estimated (Region),7556
|
| 916 |
+
2015-07-17,2015,7,Asia,Model 3,11141,9822,85188.79,121,704,1035.0,Estimated (Region),3624
|
| 917 |
+
2019-03-13,2019,3,Europe,Cybertruck,11565,12598,52061.21,100,561,1020.14,Interpolated (Month),11978
|
| 918 |
+
2022-03-16,2022,3,Middle East,Model S,18317,20893,109489.22,99,615,1480.14,Estimated (Region),9005
|
| 919 |
+
2025-07-22,2025,7,Europe,Cybertruck,10288,10667,69621.64,73,410,596.08,Estimated (Region),8048
|
| 920 |
+
2018-12-08,2018,12,North America,Model X,9056,10765,73508.93,97,616,919.76,Estimated (Region),9836
|
| 921 |
+
2021-02-18,2021,2,Middle East,Model S,11568,11420,93060.85,82,454,815.39,Official (Quarter),12009
|
| 922 |
+
2023-03-25,2023,3,North America,Model Y,6113,7473,71412.85,119,733,617.13,Interpolated (Month),3924
|
| 923 |
+
2024-03-17,2024,3,North America,Model S,3867,4478,78525.26,81,465,284.2,Estimated (Region),5704
|
| 924 |
+
2021-01-13,2021,1,Middle East,Model X,7463,7954,66030.69,77,424,432.82,Interpolated (Month),9641
|
| 925 |
+
2015-06-05,2015,6,North America,Cybertruck,12216,13307,61956.1,100,560,1034.05,Estimated (Region),3619
|
| 926 |
+
2019-07-07,2019,7,Middle East,Model X,6711,6169,101935.24,84,471,472.31,Estimated (Region),12199
|
| 927 |
+
2018-02-27,2018,2,Asia,Model Y,11591,12146,90130.97,59,326,566.7,Estimated (Region),4457
|
| 928 |
+
2023-12-16,2023,12,North America,Model S,9186,8983,109351.76,75,430,562.36,Estimated (Region),7003
|
| 929 |
+
2022-03-09,2022,3,North America,Model X,10768,9553,73117.14,75,420,637.93,Estimated (Region),12412
|
| 930 |
+
2025-04-12,2025,4,Europe,Model Y,12681,13283,110599.3,79,473,819.41,Official (Quarter),3560
|
| 931 |
+
2021-10-17,2021,10,Asia,Model 3,8251,9086,51275.5,84,489,689.2,Official (Quarter),5278
|
| 932 |
+
2025-10-16,2025,10,North America,Cybertruck,10307,10029,49172.94,82,488,657.56,Official (Quarter),6278
|
| 933 |
+
2018-11-20,2018,11,Europe,Model S,8760,9691,57831.43,61,353,470.8,Estimated (Region),7401
|
| 934 |
+
2020-10-08,2020,10,Middle East,Model 3,13596,12204,89176.1,98,576,1047.31,Interpolated (Month),13955
|
| 935 |
+
2017-10-19,2017,10,Middle East,Model S,12732,13016,57117.63,60,351,525.42,Official (Quarter),6627
|
| 936 |
+
2025-03-13,2025,3,Asia,Cybertruck,8383,9948,115991.25,59,325,412.74,Estimated (Region),6818
|
| 937 |
+
2019-08-27,2019,8,North America,Model 3,13712,13005,100820.86,61,343,691.51,Interpolated (Month),11499
|
| 938 |
+
2022-08-05,2022,8,Middle East,Cybertruck,12151,12082,91920.8,101,614,1024.72,Official (Quarter),5145
|
| 939 |
+
2016-04-05,2016,4,Europe,Model Y,12745,12907,87866.55,101,550,1162.86,Estimated (Region),8281
|
| 940 |
+
2017-06-13,2017,6,Middle East,Model 3,9745,9543,95878.95,84,461,692.39,Official (Quarter),3722
|
| 941 |
+
2016-12-15,2016,12,Asia,Model S,20354,19299,117510.19,123,734,2197.46,Official (Quarter),11790
|
| 942 |
+
2019-07-20,2019,7,North America,Model S,10320,10566,57196.93,83,467,795.97,Official (Quarter),9871
|
| 943 |
+
2015-03-12,2015,3,Europe,Cybertruck,5534,6163,72804.09,117,704,453.2,Interpolated (Month),13070
|
| 944 |
+
2018-09-26,2018,9,Europe,Model X,5316,5485,57479.84,81,478,362.8,Interpolated (Month),12022
|
| 945 |
+
2020-08-14,2020,8,North America,Cybertruck,5870,6550,72968.9,59,364,309.41,Interpolated (Month),14073
|
| 946 |
+
2021-12-04,2021,12,Middle East,Model 3,7906,9613,100773.85,101,568,805.0,Interpolated (Month),6759
|
| 947 |
+
2017-04-04,2017,4,Middle East,Model S,5889,6462,97514.81,120,690,643.36,Estimated (Region),13506
|
| 948 |
+
2015-05-28,2015,5,Europe,Model S,9791,9167,59235.91,117,669,851.54,Interpolated (Month),10611
|
| 949 |
+
2017-11-04,2017,11,Middle East,Cybertruck,16062,16333,90569.06,100,598,1487.57,Official (Quarter),13811
|
| 950 |
+
2024-12-27,2024,12,Middle East,Model S,6385,6873,96367.47,58,376,318.22,Interpolated (Month),14013
|
| 951 |
+
2021-06-08,2021,6,North America,Model Y,9364,9747,98924.48,82,450,622.15,Official (Quarter),6422
|
| 952 |
+
2025-08-03,2025,8,Europe,Model Y,10634,12334,108595.48,73,426,717.05,Estimated (Region),7412
|
| 953 |
+
2022-07-09,2022,7,Asia,Model Y,7787,8339,76889.77,121,657,815.61,Estimated (Region),11070
|
| 954 |
+
2020-05-18,2020,5,Middle East,Model X,3682,4232,72384.76,121,728,476.93,Official (Quarter),3760
|
| 955 |
+
2018-05-12,2018,5,Asia,Cybertruck,5450,5413,107537.41,62,332,283.83,Estimated (Region),7272
|
| 956 |
+
2024-02-22,2024,2,Asia,Model Y,11743,12187,104578.67,83,446,818.04,Official (Quarter),11632
|
| 957 |
+
2016-04-18,2016,4,Asia,Cybertruck,2597,2675,79715.4,119,684,297.15,Official (Quarter),9684
|
| 958 |
+
2021-09-12,2021,9,Middle East,Cybertruck,10112,12605,67857.48,122,715,1387.65,Estimated (Region),14157
|
| 959 |
+
2017-04-18,2017,4,Asia,Model X,2705,3222,52181.42,117,673,306.73,Estimated (Region),11732
|
| 960 |
+
2023-03-28,2023,3,Asia,Model X,7379,7759,80797.85,80,462,531.01,Interpolated (Month),11227
|
| 961 |
+
2024-10-12,2024,10,Asia,Model Y,8846,10122,122739.56,83,478,688.0,Official (Quarter),12875
|
| 962 |
+
2017-01-05,2017,1,Middle East,Model Y,8241,9311,112587.94,96,548,702.64,Estimated (Region),13624
|
| 963 |
+
2016-07-12,2016,7,Europe,Cybertruck,12860,13797,80535.64,100,566,1262.39,Estimated (Region),5795
|
| 964 |
+
2024-12-24,2024,12,Europe,Model Y,7141,7739,112777.57,80,481,478.16,Official (Quarter),12152
|
| 965 |
+
2022-03-07,2022,3,Middle East,Cybertruck,10550,11861,96307.68,75,442,682.47,Official (Quarter),5351
|
| 966 |
+
2016-02-27,2016,2,Middle East,Model X,5506,7052,52848.16,80,481,454.75,Official (Quarter),8311
|
| 967 |
+
2018-04-17,2018,4,Europe,Model X,23970,23968,77469.58,61,318,1215.39,Interpolated (Month),11698
|
| 968 |
+
2015-04-17,2015,4,Middle East,Model 3,11175,11111,83780.66,120,676,1054.11,Estimated (Region),7376
|
| 969 |
+
2020-10-09,2020,10,Europe,Cybertruck,11290,12096,83130.19,62,347,553.61,Official (Quarter),15574
|
| 970 |
+
2023-06-26,2023,6,Asia,Cybertruck,10315,12672,83357.83,120,706,1252.14,Official (Quarter),7451
|
| 971 |
+
2015-04-02,2015,4,Asia,Model X,14864,15457,109690.23,98,588,1427.69,Estimated (Region),7195
|
| 972 |
+
2016-08-09,2016,8,Middle East,Model Y,17939,19191,79359.78,60,348,960.4,Interpolated (Month),8877
|
| 973 |
+
2025-10-12,2025,10,North America,Model 3,5537,5876,67608.0,97,603,466.08,Estimated (Region),9239
|
| 974 |
+
2016-06-14,2016,6,Asia,Model X,12401,12450,90059.2,76,435,874.65,Official (Quarter),13144
|
| 975 |
+
2021-05-14,2021,5,Middle East,Model S,16197,16181,70980.3,101,584,1348.96,Interpolated (Month),4955
|
| 976 |
+
2021-05-05,2021,5,North America,Model X,8563,8922,79794.82,79,454,545.52,Estimated (Region),4325
|
| 977 |
+
2017-02-07,2017,2,Asia,Cybertruck,14340,14556,119159.83,74,394,812.76,Interpolated (Month),3438
|
| 978 |
+
2022-10-03,2022,10,Asia,Model Y,9923,10167,109490.66,75,434,632.5,Interpolated (Month),14516
|
| 979 |
+
2021-02-17,2021,2,Europe,Cybertruck,12287,10605,80753.53,119,676,1089.75,Official (Quarter),13984
|
| 980 |
+
2025-12-10,2025,12,Asia,Model 3,8556,7953,72438.34,82,475,626.01,Official (Quarter),13581
|
| 981 |
+
2023-02-16,2023,2,Europe,Model X,10860,9735,88461.98,83,487,821.2,Estimated (Region),12703
|
| 982 |
+
2017-10-17,2017,10,North America,Model S,17171,18337,72892.73,82,487,1408.2,Interpolated (Month),4969
|
| 983 |
+
2023-10-20,2023,10,Middle East,Model 3,15063,15655,96604.63,102,572,1364.08,Estimated (Region),8198
|
| 984 |
+
2023-08-16,2023,8,North America,Model X,8787,9115,79556.85,81,484,664.07,Estimated (Region),6238
|
| 985 |
+
2024-04-19,2024,4,Europe,Model 3,13776,14377,57121.42,61,323,659.78,Official (Quarter),9000
|
| 986 |
+
2025-01-17,2025,1,Asia,Model Y,7850,8278,94011.64,76,423,441.58,Interpolated (Month),4449
|
| 987 |
+
2020-02-19,2020,2,Europe,Cybertruck,18057,21253,124675.28,100,585,1741.82,Interpolated (Month),6706
|
| 988 |
+
2016-02-18,2016,2,Middle East,Model S,10680,12272,108615.8,119,732,1219.0,Official (Quarter),11585
|
| 989 |
+
2022-05-09,2022,5,Europe,Cybertruck,11977,15074,110622.43,79,452,1044.16,Estimated (Region),4212
|
| 990 |
+
2015-11-07,2015,11,Europe,Cybertruck,7180,7950,121147.46,98,610,783.56,Interpolated (Month),14690
|
| 991 |
+
2018-01-23,2018,1,Middle East,Model X,10739,11470,52809.02,82,461,787.38,Official (Quarter),9700
|
| 992 |
+
2015-08-10,2015,8,Middle East,Model S,15185,15758,49866.49,59,335,747.79,Interpolated (Month),7924
|
| 993 |
+
2017-03-16,2017,3,Europe,Model 3,6655,6904,120902.49,62,350,349.11,Estimated (Region),5715
|
| 994 |
+
2017-04-06,2017,4,North America,Model S,11509,15344,54021.35,61,348,630.12,Estimated (Region),7225
|
| 995 |
+
2021-04-13,2021,4,Europe,Model S,17352,17399,102047.78,59,334,748.81,Official (Quarter),15817
|
| 996 |
+
2022-09-15,2022,9,Europe,Cybertruck,10482,11136,63220.13,101,532,811.0,Interpolated (Month),8677
|
| 997 |
+
2016-07-18,2016,7,North America,Model S,10455,9472,49107.04,75,428,622.18,Official (Quarter),5151
|
| 998 |
+
2025-09-15,2025,9,North America,Model X,14590,16441,95307.53,99,569,1095.24,Interpolated (Month),3704
|
| 999 |
+
2017-03-11,2017,3,North America,Cybertruck,16003,17604,76695.29,83,501,1142.74,Estimated (Region),5716
|
| 1000 |
+
2020-07-27,2020,7,North America,Model 3,16927,17565,83307.91,76,411,972.32,Estimated (Region),11845
|
| 1001 |
+
2023-09-15,2023,9,Middle East,Model X,9735,11102,88310.73,82,466,641.41,Official (Quarter),9044
|
data/tesla_deliveries_50k.csv
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
data_processor.py
ADDED
|
@@ -0,0 +1,302 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
| 2 |
+
|
| 3 |
+
|
| 4 |
+
def load_data(file):
|
| 5 |
+
"""
|
| 6 |
+
Load a CSV or Excel file into a pandas DataFrame.
|
| 7 |
+
|
| 8 |
+
This function should work both with:
|
| 9 |
+
- a file path string
|
| 10 |
+
- a Gradio UploadedFile object (has .name)
|
| 11 |
+
"""
|
| 12 |
+
try:
|
| 13 |
+
# If "file" is a Gradio upload, it has a .name attribute.
|
| 14 |
+
if hasattr(file, "name"):
|
| 15 |
+
path = file.name
|
| 16 |
+
else:
|
| 17 |
+
path = file
|
| 18 |
+
|
| 19 |
+
if path.endswith(".csv"):
|
| 20 |
+
df = pd.read_csv(path)
|
| 21 |
+
elif path.endswith(".xlsx") or path.endswith(".xls"):
|
| 22 |
+
df = pd.read_excel(path)
|
| 23 |
+
else:
|
| 24 |
+
raise ValueError("Only .csv, .xlsx, or .xls files are supported.")
|
| 25 |
+
|
| 26 |
+
# Try to parse any column that already looks like a date.
|
| 27 |
+
# For your Tesla data, "Date" will be parsed correctly.
|
| 28 |
+
for col in df.columns:
|
| 29 |
+
if "date" in col.lower():
|
| 30 |
+
try:
|
| 31 |
+
df[col] = pd.to_datetime(df[col])
|
| 32 |
+
except Exception:
|
| 33 |
+
# If parsing fails, just keep it as is.
|
| 34 |
+
pass
|
| 35 |
+
|
| 36 |
+
return df, None
|
| 37 |
+
|
| 38 |
+
except Exception as e:
|
| 39 |
+
# Return None and an error message so Gradio can display it.
|
| 40 |
+
return None, f"Error loading data: {e}"
|
| 41 |
+
|
| 42 |
+
|
| 43 |
+
def get_basic_info(df):
|
| 44 |
+
"""
|
| 45 |
+
Return basic information about the dataset:
|
| 46 |
+
- number of rows and columns
|
| 47 |
+
- column names
|
| 48 |
+
- data types as strings
|
| 49 |
+
"""
|
| 50 |
+
shape = df.shape
|
| 51 |
+
columns = list(df.columns)
|
| 52 |
+
dtypes = df.dtypes.astype(str).to_dict()
|
| 53 |
+
|
| 54 |
+
info = {
|
| 55 |
+
"n_rows": shape[0],
|
| 56 |
+
"n_cols": shape[1],
|
| 57 |
+
"columns": columns,
|
| 58 |
+
"dtypes": dtypes,
|
| 59 |
+
}
|
| 60 |
+
return info
|
| 61 |
+
|
| 62 |
+
|
| 63 |
+
def detect_column_types(df):
|
| 64 |
+
"""
|
| 65 |
+
Split columns into:
|
| 66 |
+
- numeric_cols
|
| 67 |
+
- categorical_cols
|
| 68 |
+
- date_cols
|
| 69 |
+
|
| 70 |
+
This will be used for:
|
| 71 |
+
- summary statistics
|
| 72 |
+
- filters
|
| 73 |
+
- visualizations
|
| 74 |
+
"""
|
| 75 |
+
numeric_cols = df.select_dtypes(include=["number"]).columns.tolist()
|
| 76 |
+
date_cols = df.select_dtypes(include=["datetime64[ns]", "datetime64[ns, UTC]"]).columns.tolist()
|
| 77 |
+
|
| 78 |
+
# Everything else is treated as categorical for this project.
|
| 79 |
+
categorical_cols = [col for col in df.columns if col not in numeric_cols + date_cols]
|
| 80 |
+
|
| 81 |
+
col_types = {
|
| 82 |
+
"numeric": numeric_cols,
|
| 83 |
+
"categorical": categorical_cols,
|
| 84 |
+
"date": date_cols,
|
| 85 |
+
}
|
| 86 |
+
return col_types
|
| 87 |
+
|
| 88 |
+
|
| 89 |
+
def numeric_summary(df, numeric_cols):
|
| 90 |
+
"""
|
| 91 |
+
Calculate summary statistics for numeric columns.
|
| 92 |
+
|
| 93 |
+
Returns a DataFrame where each row is a column and
|
| 94 |
+
columns include: count, mean, std, min, 25%, 50%, 75%, max
|
| 95 |
+
"""
|
| 96 |
+
if not numeric_cols:
|
| 97 |
+
return pd.DataFrame()
|
| 98 |
+
|
| 99 |
+
summary = df[numeric_cols].describe().T # transpose so each row is a column
|
| 100 |
+
summary = summary.reset_index().rename(columns={"index": "column"})
|
| 101 |
+
return summary
|
| 102 |
+
|
| 103 |
+
|
| 104 |
+
def categorical_summary(df, categorical_cols, max_unique_to_show=20):
|
| 105 |
+
"""
|
| 106 |
+
Create a summary for categorical columns.
|
| 107 |
+
|
| 108 |
+
For each categorical column we will show:
|
| 109 |
+
- number of unique values
|
| 110 |
+
- the most frequent value (mode)
|
| 111 |
+
- frequency of the mode
|
| 112 |
+
- up to 'max_unique_to_show' value counts (for display if needed)
|
| 113 |
+
"""
|
| 114 |
+
rows = []
|
| 115 |
+
|
| 116 |
+
for col in categorical_cols:
|
| 117 |
+
series = df[col].astype("object")
|
| 118 |
+
|
| 119 |
+
n_unique = series.nunique(dropna=False)
|
| 120 |
+
|
| 121 |
+
# Mode (most common value)
|
| 122 |
+
if not series.mode(dropna=False).empty:
|
| 123 |
+
mode_value = series.mode(dropna=False).iloc[0]
|
| 124 |
+
else:
|
| 125 |
+
mode_value = None
|
| 126 |
+
|
| 127 |
+
value_counts = series.value_counts(dropna=False)
|
| 128 |
+
mode_freq = int(value_counts.iloc[0]) if len(value_counts) > 0 else 0
|
| 129 |
+
|
| 130 |
+
# We keep the top value counts as a JSON-like string to show in a table if needed.
|
| 131 |
+
top_values = value_counts.head(max_unique_to_show).to_dict()
|
| 132 |
+
|
| 133 |
+
rows.append(
|
| 134 |
+
{
|
| 135 |
+
"column": col,
|
| 136 |
+
"unique_values": int(n_unique),
|
| 137 |
+
"mode": mode_value,
|
| 138 |
+
"mode_freq": mode_freq,
|
| 139 |
+
"top_values": str(top_values),
|
| 140 |
+
}
|
| 141 |
+
)
|
| 142 |
+
|
| 143 |
+
if not rows:
|
| 144 |
+
return pd.DataFrame()
|
| 145 |
+
|
| 146 |
+
summary_df = pd.DataFrame(rows)
|
| 147 |
+
return summary_df
|
| 148 |
+
|
| 149 |
+
|
| 150 |
+
def missing_values_report(df):
|
| 151 |
+
"""
|
| 152 |
+
Return a DataFrame with:
|
| 153 |
+
- column name
|
| 154 |
+
- number of missing values
|
| 155 |
+
- percentage of missing values
|
| 156 |
+
"""
|
| 157 |
+
total_rows = len(df)
|
| 158 |
+
missing_counts = df.isna().sum()
|
| 159 |
+
|
| 160 |
+
rows = []
|
| 161 |
+
for col, count in missing_counts.items():
|
| 162 |
+
if total_rows > 0:
|
| 163 |
+
pct = (count / total_rows) * 100
|
| 164 |
+
else:
|
| 165 |
+
pct = 0.0
|
| 166 |
+
rows.append(
|
| 167 |
+
{
|
| 168 |
+
"column": col,
|
| 169 |
+
"missing_count": int(count),
|
| 170 |
+
"missing_pct": round(pct, 2),
|
| 171 |
+
}
|
| 172 |
+
)
|
| 173 |
+
|
| 174 |
+
report_df = pd.DataFrame(rows)
|
| 175 |
+
return report_df
|
| 176 |
+
|
| 177 |
+
|
| 178 |
+
def correlation_matrix(df, numeric_cols):
|
| 179 |
+
"""
|
| 180 |
+
Compute the correlation matrix for numeric columns.
|
| 181 |
+
"""
|
| 182 |
+
if len(numeric_cols) < 2:
|
| 183 |
+
return pd.DataFrame()
|
| 184 |
+
corr = df[numeric_cols].corr()
|
| 185 |
+
return corr
|
| 186 |
+
|
| 187 |
+
|
| 188 |
+
def build_filter_metadata(df, col_types):
|
| 189 |
+
"""
|
| 190 |
+
Prepare simple metadata that the Gradio UI can use to build filters.
|
| 191 |
+
|
| 192 |
+
For numeric columns:
|
| 193 |
+
min and max value
|
| 194 |
+
|
| 195 |
+
For categorical columns:
|
| 196 |
+
sorted list of unique values
|
| 197 |
+
|
| 198 |
+
For date columns:
|
| 199 |
+
min and max date
|
| 200 |
+
"""
|
| 201 |
+
meta = {
|
| 202 |
+
"numeric": {},
|
| 203 |
+
"categorical": {},
|
| 204 |
+
"date": {},
|
| 205 |
+
}
|
| 206 |
+
|
| 207 |
+
# Numeric ranges
|
| 208 |
+
for col in col_types["numeric"]:
|
| 209 |
+
col_series = df[col].dropna()
|
| 210 |
+
if col_series.empty:
|
| 211 |
+
continue
|
| 212 |
+
meta["numeric"][col] = {
|
| 213 |
+
"min": float(col_series.min()),
|
| 214 |
+
"max": float(col_series.max()),
|
| 215 |
+
}
|
| 216 |
+
|
| 217 |
+
# Categorical unique values
|
| 218 |
+
for col in col_types["categorical"]:
|
| 219 |
+
unique_vals = df[col].dropna().unique().tolist()
|
| 220 |
+
# Convert numpy types to plain Python for safety
|
| 221 |
+
unique_vals = [str(v) for v in unique_vals]
|
| 222 |
+
meta["categorical"][col] = sorted(unique_vals)
|
| 223 |
+
|
| 224 |
+
# Date min/max
|
| 225 |
+
for col in col_types["date"]:
|
| 226 |
+
col_series = df[col].dropna()
|
| 227 |
+
if col_series.empty:
|
| 228 |
+
continue
|
| 229 |
+
meta["date"][col] = {
|
| 230 |
+
"min": col_series.min(),
|
| 231 |
+
"max": col_series.max(),
|
| 232 |
+
}
|
| 233 |
+
|
| 234 |
+
return meta
|
| 235 |
+
|
| 236 |
+
|
| 237 |
+
def apply_filters(df, numeric_filters=None, categorical_filters=None, date_filters=None):
|
| 238 |
+
"""
|
| 239 |
+
Apply simple filters to the DataFrame.
|
| 240 |
+
|
| 241 |
+
numeric_filters: dict like
|
| 242 |
+
{
|
| 243 |
+
"Estimated_Deliveries": [min_val, max_val],
|
| 244 |
+
"Production_Units": [min_val, max_val],
|
| 245 |
+
}
|
| 246 |
+
|
| 247 |
+
categorical_filters: dict like
|
| 248 |
+
{
|
| 249 |
+
"Region": ["Europe", "Asia"],
|
| 250 |
+
"Model": ["Model 3", "Model Y"],
|
| 251 |
+
}
|
| 252 |
+
|
| 253 |
+
date_filters: dict like
|
| 254 |
+
{
|
| 255 |
+
"Date": ["2018-01-01", "2023-12-31"]
|
| 256 |
+
}
|
| 257 |
+
|
| 258 |
+
All arguments are optional. If a filter dict is None, it is ignored.
|
| 259 |
+
"""
|
| 260 |
+
filtered = df.copy()
|
| 261 |
+
|
| 262 |
+
# Numeric ranges
|
| 263 |
+
if numeric_filters:
|
| 264 |
+
for col, bounds in numeric_filters.items():
|
| 265 |
+
if col not in filtered.columns:
|
| 266 |
+
continue
|
| 267 |
+
try:
|
| 268 |
+
min_val, max_val = bounds
|
| 269 |
+
filtered = filtered[
|
| 270 |
+
(filtered[col] >= min_val) & (filtered[col] <= max_val)
|
| 271 |
+
]
|
| 272 |
+
except Exception:
|
| 273 |
+
# If something goes wrong, just skip this column filter.
|
| 274 |
+
continue
|
| 275 |
+
|
| 276 |
+
# Categorical selections (multi-select)
|
| 277 |
+
if categorical_filters:
|
| 278 |
+
for col, allowed_values in categorical_filters.items():
|
| 279 |
+
if col not in filtered.columns:
|
| 280 |
+
continue
|
| 281 |
+
if not allowed_values:
|
| 282 |
+
# If list is empty, skip this filter.
|
| 283 |
+
continue
|
| 284 |
+
filtered = filtered[filtered[col].astype(str).isin(allowed_values)]
|
| 285 |
+
|
| 286 |
+
# Date range filters
|
| 287 |
+
if date_filters:
|
| 288 |
+
for col, bounds in date_filters.items():
|
| 289 |
+
if col not in filtered.columns:
|
| 290 |
+
continue
|
| 291 |
+
try:
|
| 292 |
+
start, end = bounds
|
| 293 |
+
# Convert to datetime just in case inputs are strings.
|
| 294 |
+
start = pd.to_datetime(start)
|
| 295 |
+
end = pd.to_datetime(end)
|
| 296 |
+
filtered = filtered[
|
| 297 |
+
(filtered[col] >= start) & (filtered[col] <= end)
|
| 298 |
+
]
|
| 299 |
+
except Exception:
|
| 300 |
+
continue
|
| 301 |
+
|
| 302 |
+
return filtered
|
insights.py
ADDED
|
@@ -0,0 +1,240 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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import pandas as pd
|
| 2 |
+
import numpy as np
|
| 3 |
+
|
| 4 |
+
|
| 5 |
+
def top_bottom_groups(df, group_col, value_col, top_n=3):
|
| 6 |
+
"""
|
| 7 |
+
Group by `group_col`, sum `value_col`, and return NON-overlapping
|
| 8 |
+
top and bottom groups.
|
| 9 |
+
|
| 10 |
+
This is used for things like:
|
| 11 |
+
- Top / bottom models by Estimated_Deliveries
|
| 12 |
+
|
| 13 |
+
Returns a dict:
|
| 14 |
+
{
|
| 15 |
+
"top": DataFrame,
|
| 16 |
+
"bottom": DataFrame
|
| 17 |
+
}
|
| 18 |
+
"""
|
| 19 |
+
grouped = (
|
| 20 |
+
df.groupby(group_col)[value_col]
|
| 21 |
+
.sum()
|
| 22 |
+
.reset_index()
|
| 23 |
+
.rename(columns={value_col: f"total_{value_col}"})
|
| 24 |
+
)
|
| 25 |
+
|
| 26 |
+
if grouped.empty:
|
| 27 |
+
return {"top": pd.DataFrame(), "bottom": pd.DataFrame()}
|
| 28 |
+
|
| 29 |
+
# Sort descending for potential "top" list
|
| 30 |
+
grouped_desc = grouped.sort_values(by=f"total_{value_col}", ascending=False)
|
| 31 |
+
|
| 32 |
+
# We only want up to half of the unique groups in each list to avoid overlap
|
| 33 |
+
max_pairs = max(1, len(grouped_desc) // 2)
|
| 34 |
+
n = min(top_n, max_pairs)
|
| 35 |
+
|
| 36 |
+
# Top n
|
| 37 |
+
top = grouped_desc.head(n).reset_index(drop=True)
|
| 38 |
+
|
| 39 |
+
# Bottom n from the remaining (no overlap with top)
|
| 40 |
+
grouped_asc = grouped.sort_values(by=f"total_{value_col}", ascending=True)
|
| 41 |
+
bottom = grouped_asc[~grouped_asc[group_col].isin(top[group_col])].head(n)
|
| 42 |
+
bottom = bottom.reset_index(drop=True)
|
| 43 |
+
|
| 44 |
+
return {"top": top, "bottom": bottom}
|
| 45 |
+
|
| 46 |
+
|
| 47 |
+
def region_ranking(df, value_col="Estimated_Deliveries"):
|
| 48 |
+
"""
|
| 49 |
+
Rank regions by total value_col (for this project: Estimated_Deliveries).
|
| 50 |
+
|
| 51 |
+
Returns a DataFrame with columns like:
|
| 52 |
+
Region, total_Estimated_Deliveries, rank
|
| 53 |
+
"""
|
| 54 |
+
if "Region" not in df.columns or value_col not in df.columns:
|
| 55 |
+
return pd.DataFrame()
|
| 56 |
+
|
| 57 |
+
grouped = (
|
| 58 |
+
df.groupby("Region")[value_col]
|
| 59 |
+
.sum()
|
| 60 |
+
.reset_index()
|
| 61 |
+
.rename(columns={value_col: f"total_{value_col}"})
|
| 62 |
+
)
|
| 63 |
+
|
| 64 |
+
if grouped.empty:
|
| 65 |
+
return grouped
|
| 66 |
+
|
| 67 |
+
grouped = grouped.sort_values(by=f"total_{value_col}", ascending=False)
|
| 68 |
+
grouped["rank"] = range(1, len(grouped) + 1)
|
| 69 |
+
return grouped.reset_index(drop=True)
|
| 70 |
+
|
| 71 |
+
|
| 72 |
+
def model_production_vs_delivery(
|
| 73 |
+
df,
|
| 74 |
+
model_col="Model",
|
| 75 |
+
deliveries_col="Estimated_Deliveries",
|
| 76 |
+
prod_col="Production_Units",
|
| 77 |
+
):
|
| 78 |
+
"""
|
| 79 |
+
Compare total production vs total estimated deliveries by model.
|
| 80 |
+
|
| 81 |
+
Returns a DataFrame with:
|
| 82 |
+
Model,
|
| 83 |
+
total_estimated_deliveries,
|
| 84 |
+
total_production_units,
|
| 85 |
+
delivery_rate_percent,
|
| 86 |
+
inventory_gap
|
| 87 |
+
"""
|
| 88 |
+
needed_cols = [model_col, deliveries_col, prod_col]
|
| 89 |
+
for c in needed_cols:
|
| 90 |
+
if c not in df.columns:
|
| 91 |
+
return pd.DataFrame()
|
| 92 |
+
|
| 93 |
+
tmp = df[[model_col, deliveries_col, prod_col]].copy()
|
| 94 |
+
|
| 95 |
+
grouped = (
|
| 96 |
+
tmp.groupby(model_col)[[deliveries_col, prod_col]]
|
| 97 |
+
.sum()
|
| 98 |
+
.reset_index()
|
| 99 |
+
.rename(
|
| 100 |
+
columns={
|
| 101 |
+
deliveries_col: "total_estimated_deliveries",
|
| 102 |
+
prod_col: "total_production_units",
|
| 103 |
+
}
|
| 104 |
+
)
|
| 105 |
+
)
|
| 106 |
+
|
| 107 |
+
if grouped.empty:
|
| 108 |
+
return grouped
|
| 109 |
+
|
| 110 |
+
# Delivery rate = deliveries / production * 100
|
| 111 |
+
grouped["delivery_rate_percent"] = grouped.apply(
|
| 112 |
+
lambda row: (row["total_estimated_deliveries"] / row["total_production_units"] * 100.0)
|
| 113 |
+
if row["total_production_units"] != 0
|
| 114 |
+
else None,
|
| 115 |
+
axis=1,
|
| 116 |
+
)
|
| 117 |
+
|
| 118 |
+
# Inventory gap = produced but not (yet) delivered
|
| 119 |
+
grouped["inventory_gap"] = (
|
| 120 |
+
grouped["total_production_units"] - grouped["total_estimated_deliveries"]
|
| 121 |
+
)
|
| 122 |
+
|
| 123 |
+
# Round for nicer display
|
| 124 |
+
grouped["delivery_rate_percent"] = grouped["delivery_rate_percent"].round(2)
|
| 125 |
+
|
| 126 |
+
return grouped
|
| 127 |
+
|
| 128 |
+
|
| 129 |
+
def overall_trend_summary(df, date_col, value_col, freq="Q"):
|
| 130 |
+
"""
|
| 131 |
+
Build a simple trend summary using time resampling.
|
| 132 |
+
|
| 133 |
+
For this project we use it for:
|
| 134 |
+
- Estimated_Deliveries over time (quarterly)
|
| 135 |
+
|
| 136 |
+
Returns:
|
| 137 |
+
summary_dict, quarterly_series
|
| 138 |
+
|
| 139 |
+
The summary_dict is already written in human-friendly sentences so that
|
| 140 |
+
utils.dict_to_text() will show something nice like:
|
| 141 |
+
|
| 142 |
+
start: On 2015-03-31, estimated deliveries were 9,883,795.
|
| 143 |
+
end: On 2025-12-31, estimated deliveries were 11,087,134.
|
| 144 |
+
...
|
| 145 |
+
|
| 146 |
+
quarterly_series is the resampled pandas Series (for debugging or extension).
|
| 147 |
+
"""
|
| 148 |
+
summary = {}
|
| 149 |
+
|
| 150 |
+
if date_col not in df.columns or value_col not in df.columns:
|
| 151 |
+
summary["info"] = "Trend summary unavailable — missing date or value column."
|
| 152 |
+
return summary, pd.Series(dtype="float64")
|
| 153 |
+
|
| 154 |
+
tmp = df[[date_col, value_col]].dropna().copy()
|
| 155 |
+
if tmp.empty:
|
| 156 |
+
summary["info"] = "Trend summary unavailable — no valid rows after dropping missing values."
|
| 157 |
+
return summary, pd.Series(dtype="float64")
|
| 158 |
+
|
| 159 |
+
tmp[date_col] = pd.to_datetime(tmp[date_col])
|
| 160 |
+
tmp = tmp.sort_values(by=date_col)
|
| 161 |
+
|
| 162 |
+
# Resample (e.g. quarterly) and sum
|
| 163 |
+
series = tmp.set_index(date_col)[value_col].resample(freq).sum()
|
| 164 |
+
|
| 165 |
+
if series.empty:
|
| 166 |
+
summary["info"] = "Trend summary unavailable — no data after resampling."
|
| 167 |
+
return summary, series
|
| 168 |
+
|
| 169 |
+
start_period = series.index[0]
|
| 170 |
+
end_period = series.index[-1]
|
| 171 |
+
|
| 172 |
+
start_value = float(series.iloc[0])
|
| 173 |
+
end_value = float(series.iloc[-1])
|
| 174 |
+
|
| 175 |
+
absolute_change = end_value - start_value
|
| 176 |
+
percent_change = (absolute_change / start_value * 100.0) if start_value != 0 else None
|
| 177 |
+
|
| 178 |
+
best_period = series.idxmax()
|
| 179 |
+
best_value = float(series.max())
|
| 180 |
+
|
| 181 |
+
# These strings already contain date + number as you requested
|
| 182 |
+
summary["start"] = (
|
| 183 |
+
f"On {start_period.date()}, estimated deliveries were {start_value:,.0f}."
|
| 184 |
+
)
|
| 185 |
+
summary["end"] = (
|
| 186 |
+
f"On {end_period.date()}, estimated deliveries were {end_value:,.0f}."
|
| 187 |
+
)
|
| 188 |
+
summary["change"] = (
|
| 189 |
+
f"From {start_period.date()} to {end_period.date()}, deliveries changed by "
|
| 190 |
+
f"{absolute_change:,.0f} units."
|
| 191 |
+
)
|
| 192 |
+
if percent_change is not None:
|
| 193 |
+
summary["growth"] = (
|
| 194 |
+
f"Overall growth between the first and last period is {percent_change:.2f}%."
|
| 195 |
+
)
|
| 196 |
+
else:
|
| 197 |
+
summary["growth"] = "Overall growth percentage could not be computed (start value is 0)."
|
| 198 |
+
|
| 199 |
+
summary["best_quarter"] = (
|
| 200 |
+
f"The highest quarter in this dataset is {best_period.date()} "
|
| 201 |
+
f"with {best_value:,.0f} estimated deliveries."
|
| 202 |
+
)
|
| 203 |
+
|
| 204 |
+
return summary, series
|
| 205 |
+
|
| 206 |
+
|
| 207 |
+
# Optional: kept here in case you want to experiment later.
|
| 208 |
+
# Not used by app.py in the current design.
|
| 209 |
+
def simple_anomaly_detection(df, date_col, value_col, freq="Q", z_threshold=2.0):
|
| 210 |
+
"""
|
| 211 |
+
Simple anomaly detection based on z-scores of resampled values.
|
| 212 |
+
|
| 213 |
+
NOT used in the current dashboard, but left here for potential extensions.
|
| 214 |
+
"""
|
| 215 |
+
summary, series = overall_trend_summary(df, date_col, value_col, freq=freq)
|
| 216 |
+
|
| 217 |
+
if series is None or series.empty:
|
| 218 |
+
return pd.DataFrame()
|
| 219 |
+
|
| 220 |
+
values = series.values.astype(float)
|
| 221 |
+
mean = values.mean()
|
| 222 |
+
std = values.std()
|
| 223 |
+
|
| 224 |
+
if std == 0:
|
| 225 |
+
return pd.DataFrame()
|
| 226 |
+
|
| 227 |
+
z_scores = (values - mean) / std
|
| 228 |
+
mask = np.abs(z_scores) >= z_threshold
|
| 229 |
+
|
| 230 |
+
if not mask.any():
|
| 231 |
+
return pd.DataFrame()
|
| 232 |
+
|
| 233 |
+
out = pd.DataFrame(
|
| 234 |
+
{
|
| 235 |
+
"period": series.index[mask].astype(str),
|
| 236 |
+
"value": values[mask],
|
| 237 |
+
"z_score": z_scores[mask],
|
| 238 |
+
}
|
| 239 |
+
)
|
| 240 |
+
return out
|
prepare_tesla_data.py
ADDED
|
@@ -0,0 +1,194 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
prepare_tesla_data.py
|
| 3 |
+
|
| 4 |
+
This script takes the cleaned Tesla dataset in:
|
| 5 |
+
data/tesla_clean_full.csv
|
| 6 |
+
|
| 7 |
+
and generates two synthetic datasets:
|
| 8 |
+
|
| 9 |
+
data/tesla_deliveries_1k.csv ~ 1,000 rows
|
| 10 |
+
data/tesla_deliveries_50k.csv ~ 50,000 rows
|
| 11 |
+
|
| 12 |
+
It also makes sure there is a proper Date column built
|
| 13 |
+
from Year and Month so the dashboard can use time series
|
| 14 |
+
charts and trend insights.
|
| 15 |
+
"""
|
| 16 |
+
|
| 17 |
+
import os
|
| 18 |
+
from pathlib import Path
|
| 19 |
+
|
| 20 |
+
import numpy as np
|
| 21 |
+
import pandas as pd
|
| 22 |
+
|
| 23 |
+
# -------------------------------------------------------------------
|
| 24 |
+
# CONFIG
|
| 25 |
+
# -------------------------------------------------------------------
|
| 26 |
+
|
| 27 |
+
# Cleaned base dataset (already downloaded + cleaned from Kaggle)
|
| 28 |
+
CLEAN_FILE = Path("data") / "tesla_clean_full.csv"
|
| 29 |
+
|
| 30 |
+
# Output files (synthetic samples)
|
| 31 |
+
OUT_DIR = Path("data")
|
| 32 |
+
OUT_1K = OUT_DIR / "tesla_deliveries_1k.csv"
|
| 33 |
+
OUT_50K = OUT_DIR / "tesla_deliveries_50k.csv"
|
| 34 |
+
|
| 35 |
+
RANDOM_SEED = 42
|
| 36 |
+
|
| 37 |
+
|
| 38 |
+
# -------------------------------------------------------------------
|
| 39 |
+
# Helper functions
|
| 40 |
+
# -------------------------------------------------------------------
|
| 41 |
+
|
| 42 |
+
def load_clean_data(path: Path) -> pd.DataFrame:
|
| 43 |
+
"""
|
| 44 |
+
Load the cleaned Tesla dataset and make sure it has:
|
| 45 |
+
- Date column (datetime)
|
| 46 |
+
- Year and Month columns in sync with Date
|
| 47 |
+
|
| 48 |
+
If there is no Date column but we have Year and Month,
|
| 49 |
+
we create Date as the first day of that month.
|
| 50 |
+
"""
|
| 51 |
+
if not path.exists():
|
| 52 |
+
raise FileNotFoundError(
|
| 53 |
+
f"Could not find cleaned file at: {path}\n"
|
| 54 |
+
"Make sure data/tesla_clean_full.csv exists."
|
| 55 |
+
)
|
| 56 |
+
|
| 57 |
+
df = pd.read_csv(path)
|
| 58 |
+
|
| 59 |
+
# If Date is missing but Year + Month exist, create it
|
| 60 |
+
if "Date" not in df.columns:
|
| 61 |
+
if "Year" in df.columns and "Month" in df.columns:
|
| 62 |
+
# Make sure they are integers
|
| 63 |
+
df["Year"] = df["Year"].astype(int)
|
| 64 |
+
df["Month"] = df["Month"].astype(int)
|
| 65 |
+
|
| 66 |
+
df["Date"] = pd.to_datetime(
|
| 67 |
+
df[["Year", "Month"]].assign(DAY=1)
|
| 68 |
+
)
|
| 69 |
+
else:
|
| 70 |
+
raise ValueError(
|
| 71 |
+
"Data does not have a Date column or Year/Month columns. "
|
| 72 |
+
"Cannot construct a proper Date."
|
| 73 |
+
)
|
| 74 |
+
else:
|
| 75 |
+
# Parse Date if it exists
|
| 76 |
+
df["Date"] = pd.to_datetime(df["Date"])
|
| 77 |
+
|
| 78 |
+
# Make Year / Month match Date (in case they were inconsistent)
|
| 79 |
+
df["Year"] = df["Date"].dt.year
|
| 80 |
+
df["Month"] = df["Date"].dt.month
|
| 81 |
+
|
| 82 |
+
# Sort for nicer behavior
|
| 83 |
+
df = df.sort_values(["Date", "Region", "Model"]).reset_index(drop=True)
|
| 84 |
+
return df
|
| 85 |
+
|
| 86 |
+
|
| 87 |
+
def make_synthetic_from_clean(
|
| 88 |
+
df: pd.DataFrame,
|
| 89 |
+
target_rows: int,
|
| 90 |
+
seed: int = RANDOM_SEED,
|
| 91 |
+
) -> pd.DataFrame:
|
| 92 |
+
"""
|
| 93 |
+
Create a synthetic dataset with around target_rows rows.
|
| 94 |
+
|
| 95 |
+
Steps:
|
| 96 |
+
1. Repeat the base dataset enough times.
|
| 97 |
+
2. Sample down to exactly target_rows rows (with replacement).
|
| 98 |
+
3. Add small random noise to numeric columns.
|
| 99 |
+
4. Jitter Date by a few days, and re-sync Year / Month.
|
| 100 |
+
"""
|
| 101 |
+
rng = np.random.default_rng(seed)
|
| 102 |
+
|
| 103 |
+
base_n = len(df)
|
| 104 |
+
repeats = int(np.ceil(target_rows / base_n))
|
| 105 |
+
|
| 106 |
+
# Repeat the dataset and then sample rows
|
| 107 |
+
df_rep = pd.concat([df] * repeats, ignore_index=True)
|
| 108 |
+
df_rep = df_rep.sample(n=target_rows, random_state=seed).reset_index(drop=True)
|
| 109 |
+
|
| 110 |
+
# ---- Jitter Date slightly (0–27 days) ----
|
| 111 |
+
# This keeps the general time pattern but avoids exact duplicates.
|
| 112 |
+
date_jitter_days = rng.integers(0, 28, size=len(df_rep))
|
| 113 |
+
jitter = pd.to_timedelta(date_jitter_days, unit="D")
|
| 114 |
+
df_rep["Date"] = df_rep["Date"] + jitter
|
| 115 |
+
|
| 116 |
+
# Recompute Year / Month so they match the new Date
|
| 117 |
+
df_rep["Year"] = df_rep["Date"].dt.year
|
| 118 |
+
df_rep["Month"] = df_rep["Date"].dt.month
|
| 119 |
+
|
| 120 |
+
# ---- Add noise to numeric columns ----
|
| 121 |
+
# Columns we expect from the Tesla dataset. If some are missing,
|
| 122 |
+
# we just skip them.
|
| 123 |
+
noise_specs = {
|
| 124 |
+
"Estimated_Deliveries": 0.05, # ±5%
|
| 125 |
+
"Production_Units": 0.05, # ±5%
|
| 126 |
+
"Avg_Price_USD": 0.03, # ±3%
|
| 127 |
+
"Battery_Capacity_kWh": 0.02, # ±2%
|
| 128 |
+
"Range_km": 0.03, # ±3%
|
| 129 |
+
"CO2_Saved_tons": 0.08, # ±8%
|
| 130 |
+
"Charging_Stations": 0.05, # ±5%
|
| 131 |
+
}
|
| 132 |
+
|
| 133 |
+
for col, pct in noise_specs.items():
|
| 134 |
+
if col not in df_rep.columns:
|
| 135 |
+
continue # skip if this column doesn't exist
|
| 136 |
+
|
| 137 |
+
# 1 + N(0, pct) multiplier
|
| 138 |
+
factors = 1.0 + rng.normal(loc=0.0, scale=pct, size=len(df_rep))
|
| 139 |
+
df_rep[col] = df_rep[col].astype(float) * factors
|
| 140 |
+
|
| 141 |
+
# Integer-like columns
|
| 142 |
+
if col in ["Estimated_Deliveries", "Production_Units", "Charging_Stations"]:
|
| 143 |
+
df_rep[col] = df_rep[col].round().astype(int)
|
| 144 |
+
df_rep[col] = df_rep[col].clip(lower=0)
|
| 145 |
+
|
| 146 |
+
# Capacity and range can also be integers
|
| 147 |
+
if col in ["Battery_Capacity_kWh", "Range_km"]:
|
| 148 |
+
df_rep[col] = df_rep[col].round().astype(int)
|
| 149 |
+
df_rep[col] = df_rep[col].clip(lower=0)
|
| 150 |
+
|
| 151 |
+
# Price and CO2 can stay as floats but nicely rounded
|
| 152 |
+
if col in ["Avg_Price_USD", "CO2_Saved_tons"]:
|
| 153 |
+
df_rep[col] = df_rep[col].round(2)
|
| 154 |
+
|
| 155 |
+
# Make sure columns are in the same order as the original df
|
| 156 |
+
df_rep = df_rep[df.columns]
|
| 157 |
+
return df_rep
|
| 158 |
+
|
| 159 |
+
|
| 160 |
+
# -------------------------------------------------------------------
|
| 161 |
+
# Main script
|
| 162 |
+
# -------------------------------------------------------------------
|
| 163 |
+
|
| 164 |
+
def main():
|
| 165 |
+
# Ensure output directory exists
|
| 166 |
+
OUT_DIR.mkdir(parents=True, exist_ok=True)
|
| 167 |
+
|
| 168 |
+
print(f"Loading cleaned Tesla data from: {CLEAN_FILE}")
|
| 169 |
+
df_clean = load_clean_data(CLEAN_FILE)
|
| 170 |
+
print(f"Base cleaned data shape: {df_clean.shape}")
|
| 171 |
+
|
| 172 |
+
# (Optional) re-save the cleaned full dataset so we are sure it
|
| 173 |
+
# includes the Date column and synced Year/Month.
|
| 174 |
+
clean_out = OUT_DIR / "tesla_clean_full.csv"
|
| 175 |
+
df_clean.to_csv(clean_out, index=False)
|
| 176 |
+
print(f"Re-saved cleaned full dataset to: {clean_out}")
|
| 177 |
+
|
| 178 |
+
# ---- Create 1K synthetic sample ----
|
| 179 |
+
df_1k = make_synthetic_from_clean(df_clean, target_rows=1000, seed=RANDOM_SEED)
|
| 180 |
+
df_1k.to_csv(OUT_1K, index=False)
|
| 181 |
+
print(f"Saved synthetic 1K dataset to: {OUT_1K} (rows={len(df_1k)})")
|
| 182 |
+
|
| 183 |
+
# ---- Create 50K synthetic sample ----
|
| 184 |
+
df_50k = make_synthetic_from_clean(df_clean, target_rows=50000, seed=RANDOM_SEED + 1)
|
| 185 |
+
df_50k.to_csv(OUT_50K, index=False)
|
| 186 |
+
print(f"Saved synthetic 50K dataset to: {OUT_50K} (rows={len(df_50k)})")
|
| 187 |
+
|
| 188 |
+
# Show a small preview of the 50K dataset so we can eyeball it
|
| 189 |
+
print("\nSample of 50K synthetic dataset (first 5 rows):")
|
| 190 |
+
print(df_50k.head())
|
| 191 |
+
|
| 192 |
+
|
| 193 |
+
if __name__ == "__main__":
|
| 194 |
+
main()
|
requirements.txt
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
pandas==2.2.1
|
| 2 |
+
matplotlib==3.8.2
|
| 3 |
+
seaborn==0.13.1
|
| 4 |
+
plotly==5.18.0
|
| 5 |
+
gradio==4.19.2
|
| 6 |
+
numpy==1.26.2
|
utils.py
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import io
|
| 2 |
+
import base64
|
| 3 |
+
import matplotlib.pyplot as plt
|
| 4 |
+
|
| 5 |
+
|
| 6 |
+
def figure_to_png_bytes(fig):
|
| 7 |
+
"""
|
| 8 |
+
Convert a matplotlib figure to PNG bytes.
|
| 9 |
+
Useful for exporting images in Gradio.
|
| 10 |
+
"""
|
| 11 |
+
buf = io.BytesIO()
|
| 12 |
+
fig.savefig(buf, format="png", dpi=150, bbox_inches="tight")
|
| 13 |
+
buf.seek(0)
|
| 14 |
+
return buf.getvalue()
|
| 15 |
+
|
| 16 |
+
|
| 17 |
+
def safe_get(d, key, default=None):
|
| 18 |
+
"""
|
| 19 |
+
Helper to safely get values from dictionaries.
|
| 20 |
+
"""
|
| 21 |
+
if d is None:
|
| 22 |
+
return default
|
| 23 |
+
return d.get(key, default)
|
| 24 |
+
|
| 25 |
+
|
| 26 |
+
def dict_to_text(d):
|
| 27 |
+
"""
|
| 28 |
+
Simple helper to display a dictionary as multi-line text.
|
| 29 |
+
Useful for showing the trend summary in the Insights tab.
|
| 30 |
+
"""
|
| 31 |
+
if not isinstance(d, dict) or len(d) == 0:
|
| 32 |
+
return "No insights available."
|
| 33 |
+
|
| 34 |
+
lines = []
|
| 35 |
+
for k, v in d.items():
|
| 36 |
+
lines.append(f"{k}: {v}")
|
| 37 |
+
return "\n".join(lines)
|
visualizations.py
ADDED
|
@@ -0,0 +1,330 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import pandas as pd
|
| 2 |
+
import matplotlib.pyplot as plt
|
| 3 |
+
|
| 4 |
+
|
| 5 |
+
def _safe_title(text):
|
| 6 |
+
"""Small helper to avoid None or empty titles."""
|
| 7 |
+
if text is None:
|
| 8 |
+
return ""
|
| 9 |
+
return str(text)
|
| 10 |
+
|
| 11 |
+
|
| 12 |
+
def create_time_series_plot(df, date_col, value_col, agg_func="sum", freq="M", category_col=None):
|
| 13 |
+
"""
|
| 14 |
+
Create a time series line plot.
|
| 15 |
+
|
| 16 |
+
If category_col is provided (for example "Region" or "Model"),
|
| 17 |
+
it will draw one line per category with a legend.
|
| 18 |
+
|
| 19 |
+
Parameters
|
| 20 |
+
----------
|
| 21 |
+
df : pd.DataFrame
|
| 22 |
+
Input data.
|
| 23 |
+
date_col : str
|
| 24 |
+
Column name with datetime values (e.g. "Date").
|
| 25 |
+
value_col : str
|
| 26 |
+
Numeric column to aggregate (e.g. "Estimated_Deliveries").
|
| 27 |
+
agg_func : str
|
| 28 |
+
Aggregation method: "sum", "mean", "count", "median".
|
| 29 |
+
freq : str
|
| 30 |
+
Resampling frequency ("M" = month, "Q" = quarter).
|
| 31 |
+
category_col : str or None
|
| 32 |
+
Optional column to group by (e.g. "Region" or "Model").
|
| 33 |
+
|
| 34 |
+
Returns
|
| 35 |
+
-------
|
| 36 |
+
fig : matplotlib.figure.Figure or None
|
| 37 |
+
The figure object with the plot, or None if something fails.
|
| 38 |
+
"""
|
| 39 |
+
if date_col not in df.columns or value_col not in df.columns:
|
| 40 |
+
return None
|
| 41 |
+
|
| 42 |
+
data = df.copy()
|
| 43 |
+
|
| 44 |
+
# Make sure date column is datetime
|
| 45 |
+
if not pd.api.types.is_datetime64_any_dtype(data[date_col]):
|
| 46 |
+
try:
|
| 47 |
+
data[date_col] = pd.to_datetime(data[date_col])
|
| 48 |
+
except Exception:
|
| 49 |
+
return None
|
| 50 |
+
|
| 51 |
+
# If no category, just aggregate the whole series over time (old behavior)
|
| 52 |
+
if category_col is None or category_col not in df.columns:
|
| 53 |
+
data = data.set_index(date_col)
|
| 54 |
+
|
| 55 |
+
if agg_func == "mean":
|
| 56 |
+
grouped = data[value_col].resample(freq).mean()
|
| 57 |
+
elif agg_func == "count":
|
| 58 |
+
grouped = data[value_col].resample(freq).count()
|
| 59 |
+
elif agg_func == "median":
|
| 60 |
+
grouped = data[value_col].resample(freq).median()
|
| 61 |
+
else:
|
| 62 |
+
# default to sum
|
| 63 |
+
grouped = data[value_col].resample(freq).sum()
|
| 64 |
+
|
| 65 |
+
fig, ax = plt.subplots()
|
| 66 |
+
ax.plot(grouped.index, grouped.values)
|
| 67 |
+
ax.set_xlabel("Date")
|
| 68 |
+
ax.set_ylabel(_safe_title(value_col))
|
| 69 |
+
ax.set_title(f"Time Series of {value_col} ({agg_func})")
|
| 70 |
+
ax.grid(True)
|
| 71 |
+
fig.tight_layout()
|
| 72 |
+
return fig
|
| 73 |
+
|
| 74 |
+
# If category_col is given (e.g. Region / Model), draw a line per category.
|
| 75 |
+
data = data[[date_col, value_col, category_col]].dropna()
|
| 76 |
+
if data.empty:
|
| 77 |
+
return None
|
| 78 |
+
|
| 79 |
+
# Group by category and date (using Grouper for frequency)
|
| 80 |
+
grouped = data.groupby(
|
| 81 |
+
[category_col, pd.Grouper(key=date_col, freq=freq)]
|
| 82 |
+
)[value_col]
|
| 83 |
+
|
| 84 |
+
if agg_func == "mean":
|
| 85 |
+
grouped = grouped.mean()
|
| 86 |
+
elif agg_func == "count":
|
| 87 |
+
grouped = grouped.count()
|
| 88 |
+
elif agg_func == "median":
|
| 89 |
+
grouped = grouped.median()
|
| 90 |
+
else:
|
| 91 |
+
grouped = grouped.sum()
|
| 92 |
+
|
| 93 |
+
# Now grouped is a Series with MultiIndex: (category, date)
|
| 94 |
+
# We unstack so that the index is date and columns are categories.
|
| 95 |
+
table = grouped.unstack(0)
|
| 96 |
+
|
| 97 |
+
fig, ax = plt.subplots()
|
| 98 |
+
|
| 99 |
+
# Plot one line per category
|
| 100 |
+
for col in table.columns:
|
| 101 |
+
# Some categories might be all NaN if data is weird; skip those
|
| 102 |
+
series = table[col].dropna()
|
| 103 |
+
if series.empty:
|
| 104 |
+
continue
|
| 105 |
+
ax.plot(series.index, series.values, label=str(col))
|
| 106 |
+
|
| 107 |
+
ax.set_xlabel("Date")
|
| 108 |
+
ax.set_ylabel(_safe_title(value_col))
|
| 109 |
+
ax.set_title(f"Time Series of {value_col} by {category_col} ({agg_func})")
|
| 110 |
+
ax.grid(True)
|
| 111 |
+
ax.legend(title=_safe_title(category_col))
|
| 112 |
+
|
| 113 |
+
fig.tight_layout()
|
| 114 |
+
return fig
|
| 115 |
+
|
| 116 |
+
|
| 117 |
+
def create_distribution_plot(df, numeric_col, kind="hist", bins=30):
|
| 118 |
+
"""
|
| 119 |
+
Create a distribution plot for a numeric column.
|
| 120 |
+
|
| 121 |
+
Parameters
|
| 122 |
+
----------
|
| 123 |
+
df : pd.DataFrame
|
| 124 |
+
Input data.
|
| 125 |
+
numeric_col : str
|
| 126 |
+
Numeric column to visualize.
|
| 127 |
+
kind : str
|
| 128 |
+
"hist" for histogram, "box" for box plot.
|
| 129 |
+
bins : int
|
| 130 |
+
Number of bins for histogram.
|
| 131 |
+
|
| 132 |
+
Returns
|
| 133 |
+
-------
|
| 134 |
+
fig : matplotlib.figure.Figure or None
|
| 135 |
+
The figure object with the plot, or None if something fails.
|
| 136 |
+
"""
|
| 137 |
+
if numeric_col not in df.columns:
|
| 138 |
+
return None
|
| 139 |
+
|
| 140 |
+
series = df[numeric_col].dropna()
|
| 141 |
+
if series.empty:
|
| 142 |
+
return None
|
| 143 |
+
|
| 144 |
+
fig, ax = plt.subplots()
|
| 145 |
+
|
| 146 |
+
if kind == "box":
|
| 147 |
+
ax.boxplot(series.values, vert=True)
|
| 148 |
+
ax.set_xticks([1])
|
| 149 |
+
ax.set_xticklabels([_safe_title(numeric_col)])
|
| 150 |
+
ax.set_ylabel(_safe_title(numeric_col))
|
| 151 |
+
ax.set_title(f"Box Plot of {numeric_col}")
|
| 152 |
+
else:
|
| 153 |
+
# Default to histogram
|
| 154 |
+
ax.hist(series.values, bins=bins)
|
| 155 |
+
ax.set_xlabel(_safe_title(numeric_col))
|
| 156 |
+
ax.set_ylabel("Frequency")
|
| 157 |
+
ax.set_title(f"Histogram of {numeric_col}")
|
| 158 |
+
|
| 159 |
+
fig.tight_layout()
|
| 160 |
+
return fig
|
| 161 |
+
|
| 162 |
+
|
| 163 |
+
def create_category_bar_plot(df, category_col, value_col=None, agg_func="count", top_n=10):
|
| 164 |
+
"""
|
| 165 |
+
Create a bar chart for a categorical column.
|
| 166 |
+
|
| 167 |
+
- If value_col is None or agg_func == "count":
|
| 168 |
+
Show counts of each category.
|
| 169 |
+
- If value_col is numeric:
|
| 170 |
+
Aggregate using sum / mean / median.
|
| 171 |
+
|
| 172 |
+
This works nicely with columns like "Region" or "Model"
|
| 173 |
+
for the Tesla dataset.
|
| 174 |
+
|
| 175 |
+
Parameters
|
| 176 |
+
----------
|
| 177 |
+
df : pd.DataFrame
|
| 178 |
+
Input data.
|
| 179 |
+
category_col : str
|
| 180 |
+
Name of the categorical column (e.g. "Region").
|
| 181 |
+
value_col : str or None
|
| 182 |
+
Numeric column to aggregate (e.g. "Estimated_Deliveries"), or None.
|
| 183 |
+
agg_func : str
|
| 184 |
+
"sum", "mean", "median", or "count".
|
| 185 |
+
top_n : int
|
| 186 |
+
Show only the top N categories.
|
| 187 |
+
|
| 188 |
+
Returns
|
| 189 |
+
-------
|
| 190 |
+
fig : matplotlib.figure.Figure or None
|
| 191 |
+
The figure object with the plot, or None if something fails.
|
| 192 |
+
"""
|
| 193 |
+
if category_col not in df.columns:
|
| 194 |
+
return None
|
| 195 |
+
|
| 196 |
+
data = df.copy()
|
| 197 |
+
|
| 198 |
+
# Pure counts mode
|
| 199 |
+
if value_col is None or agg_func == "count":
|
| 200 |
+
counts = data[category_col].value_counts().head(top_n)
|
| 201 |
+
y_values = counts.values
|
| 202 |
+
x_labels = counts.index.astype(str).tolist()
|
| 203 |
+
title = f"Top {top_n} {category_col} by Count"
|
| 204 |
+
y_label = "Count"
|
| 205 |
+
else:
|
| 206 |
+
if value_col not in df.columns:
|
| 207 |
+
return None
|
| 208 |
+
|
| 209 |
+
data = data[[category_col, value_col]].dropna()
|
| 210 |
+
if data.empty:
|
| 211 |
+
return None
|
| 212 |
+
|
| 213 |
+
if agg_func == "mean":
|
| 214 |
+
grouped = data.groupby(category_col)[value_col].mean()
|
| 215 |
+
elif agg_func == "median":
|
| 216 |
+
grouped = data.groupby(category_col)[value_col].median()
|
| 217 |
+
else:
|
| 218 |
+
# default to sum
|
| 219 |
+
grouped = data.groupby(category_col)[value_col].sum()
|
| 220 |
+
|
| 221 |
+
grouped = grouped.sort_values(ascending=False).head(top_n)
|
| 222 |
+
y_values = grouped.values
|
| 223 |
+
x_labels = grouped.index.astype(str).tolist()
|
| 224 |
+
title = f"Top {top_n} {category_col} by {agg_func} of {value_col}"
|
| 225 |
+
y_label = _safe_title(value_col)
|
| 226 |
+
|
| 227 |
+
fig, ax = plt.subplots()
|
| 228 |
+
ax.bar(x_labels, y_values)
|
| 229 |
+
ax.set_xlabel(_safe_title(category_col))
|
| 230 |
+
ax.set_ylabel(y_label)
|
| 231 |
+
ax.set_title(title)
|
| 232 |
+
ax.tick_params(axis="x", rotation=45)
|
| 233 |
+
|
| 234 |
+
fig.tight_layout()
|
| 235 |
+
return fig
|
| 236 |
+
|
| 237 |
+
|
| 238 |
+
def create_scatter_plot(df, x_col, y_col, category_col=None):
|
| 239 |
+
"""
|
| 240 |
+
Create a scatter plot for two numeric columns.
|
| 241 |
+
|
| 242 |
+
If category_col is given (e.g. "Region" or "Model"),
|
| 243 |
+
points will be split by that category and a legend will be shown.
|
| 244 |
+
|
| 245 |
+
Parameters
|
| 246 |
+
----------
|
| 247 |
+
df : pd.DataFrame
|
| 248 |
+
Input data.
|
| 249 |
+
x_col : str
|
| 250 |
+
Column for x-axis.
|
| 251 |
+
y_col : str
|
| 252 |
+
Column for y-axis.
|
| 253 |
+
category_col : str or None
|
| 254 |
+
Optional column to group points by.
|
| 255 |
+
|
| 256 |
+
Returns
|
| 257 |
+
-------
|
| 258 |
+
fig : matplotlib.figure.Figure or None
|
| 259 |
+
The figure object with the plot, or None if something fails.
|
| 260 |
+
"""
|
| 261 |
+
if x_col not in df.columns or y_col not in df.columns:
|
| 262 |
+
return None
|
| 263 |
+
|
| 264 |
+
data = df[[x_col, y_col] + ([category_col] if category_col and category_col in df.columns else [])].dropna()
|
| 265 |
+
if data.empty:
|
| 266 |
+
return None
|
| 267 |
+
|
| 268 |
+
fig, ax = plt.subplots()
|
| 269 |
+
|
| 270 |
+
if category_col is None or category_col not in data.columns:
|
| 271 |
+
# Simple scatter, no categories
|
| 272 |
+
ax.scatter(data[x_col], data[y_col])
|
| 273 |
+
ax.set_title(f"Scatter Plot: {x_col} vs {y_col}")
|
| 274 |
+
else:
|
| 275 |
+
# One scatter per category, with legend
|
| 276 |
+
for cat_value, group_df in data.groupby(category_col):
|
| 277 |
+
ax.scatter(group_df[x_col], group_df[y_col], label=str(cat_value))
|
| 278 |
+
|
| 279 |
+
ax.set_title(f"Scatter Plot: {x_col} vs {y_col} by {category_col}")
|
| 280 |
+
ax.legend(title=_safe_title(category_col))
|
| 281 |
+
|
| 282 |
+
ax.set_xlabel(_safe_title(x_col))
|
| 283 |
+
ax.set_ylabel(_safe_title(y_col))
|
| 284 |
+
ax.grid(True)
|
| 285 |
+
|
| 286 |
+
fig.tight_layout()
|
| 287 |
+
return fig
|
| 288 |
+
|
| 289 |
+
|
| 290 |
+
def create_correlation_heatmap(df, numeric_cols):
|
| 291 |
+
"""
|
| 292 |
+
Create a correlation heatmap for numeric columns,
|
| 293 |
+
with the numeric values displayed on the cells.
|
| 294 |
+
|
| 295 |
+
Parameters
|
| 296 |
+
----------
|
| 297 |
+
df : pd.DataFrame
|
| 298 |
+
Input data.
|
| 299 |
+
numeric_cols : list of str
|
| 300 |
+
List of numeric column names to include in the correlation matrix.
|
| 301 |
+
|
| 302 |
+
Returns
|
| 303 |
+
-------
|
| 304 |
+
fig : matplotlib.figure.Figure or None
|
| 305 |
+
The figure object with the heatmap, or None if something fails.
|
| 306 |
+
"""
|
| 307 |
+
cols = [c for c in numeric_cols if c in df.columns]
|
| 308 |
+
if len(cols) < 2:
|
| 309 |
+
return None
|
| 310 |
+
|
| 311 |
+
corr = df[cols].corr()
|
| 312 |
+
|
| 313 |
+
fig, ax = plt.subplots()
|
| 314 |
+
cax = ax.matshow(corr.values)
|
| 315 |
+
fig.colorbar(cax)
|
| 316 |
+
|
| 317 |
+
ax.set_xticks(range(len(cols)))
|
| 318 |
+
ax.set_yticks(range(len(cols)))
|
| 319 |
+
ax.set_xticklabels(cols, rotation=45, ha="left")
|
| 320 |
+
ax.set_yticklabels(cols)
|
| 321 |
+
ax.set_title("Correlation Heatmap", pad=20)
|
| 322 |
+
|
| 323 |
+
# Add the correlation values on top of each cell
|
| 324 |
+
for i in range(len(cols)):
|
| 325 |
+
for j in range(len(cols)):
|
| 326 |
+
value = corr.values[i, j]
|
| 327 |
+
ax.text(j, i, f"{value:.2f}", va="center", ha="center", fontsize=8)
|
| 328 |
+
|
| 329 |
+
fig.tight_layout()
|
| 330 |
+
return fig
|