Skip to content
Electric Vehicles
DataFrameas
df
variable
SELECT *
FROM VEHICLES.CHARGING_SESSIONS
import packages
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as snsdf.info()garage_id: Identifies the garage where the charging took place.
user_id: Identifies the user.
user_type: Describes the type of user (e.g., private).
start_plugin: The timestamp of when the charging session began.
start_plugin_hour: The hour of the day when the charging session started.
end_plugout: The timestamp of when the charging session ended.
end_plugout_hour: The hour of the day when the charging session ended.
el_kwh: The amount of electricity used during the charging session in kWh.
duration_hours: The duration of the charging session in hours.
month_plugin: The month the charging session started.
weekdays_plugin: The day of the week when the charging occurred.
null values check
# Check for missing values
print(df.isnull().sum())
unique values
# Get the count of unique values in each column
unique_counts = df.nunique()
unique_countsmissing value treatment
# Drop rows with missing values
data = df.dropna()
# Display the first few rows of the cleaned dataframe to verify
data.info()data set numerical values describe
data.describe()feature enginerring
# Convert 'start_plugin' to datetime for better handling
data['start_plugin'] = pd.to_datetime(data['start_plugin'])
data['end_plugout'] = pd.to_datetime(data['end_plugout'])