Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
VinceDayrit-initial_RESIT_project-/#Serial Processing with pandas.py
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
15 lines (11 sloc)
416 Bytes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Serial Processing with pandas | |
import pandas as pd | |
import time | |
#This loads the dataset | |
df = pd.read_csv("Trips_Full_Data.csv") | |
#Measures the time for aggregation in pandas | |
start_time = time.time() | |
result_pandas = df.groupby('Trip Type')['Distance'].sum() | |
end_time = time.time() | |
pandas_time = end_time - start_time | |
print(f"Time taken for serial processing with pandas: {pandas_time:.2f} seconds") |