Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .DS_Store
Binary file not shown.
37 changes: 37 additions & 0 deletions .history/Analyze_20240207183142.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np


def import_data():
"""
Import data from the TTC Bus Delay dataset
"""
return pd.read_csv('ttc-bus-delay-data-2023.csv')


def compute_avg_delay(data, group_by: str = 'Route'):
"""
Compute the average delay aggregated by specified column
"""
<<<<<<< HEAD
return data.groupby('Route')['Min Delay'].mean().reset_index()
=======
return data.groupby(group_by).mean().reset_index()
>>>>>>> origin/feature1


def main():
"""
Main function
"""
data = import_data()
avg_delay = compute_avg_delay(data, group_by='Route')

plt.hist(avg_delay['Min Delay'], bins=30)
plt.title('Average Delay Distribution')
plt.xlabel('Average Delay (minutes)')


if __name__ == '__main__':
main()
38 changes: 38 additions & 0 deletions .history/Analyze_20240207183321.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@

import pandas as pd
import matplotlib.pyplot as plt
import numpy as np


def import_data():
"""
Import data from the TTC Bus Delay dataset
"""
return pd.read_csv('ttc-bus-delay-data-2023.csv')


def compute_avg_delay(data, group_by: str = 'Route'):
"""
Compute the average delay aggregated by specified column
"""
<<<<<<< HEAD
return data.groupby('Route')['Min Delay'].mean().reset_index()
=======
return data.groupby(group_by).mean().reset_index()
>>>>>>> origin/feature1


def main():
"""
Main function
"""
data = import_data()
avg_delay = compute_avg_delay(data, group_by='Route')

plt.hist(avg_delay['Min Delay'], bins=30)
plt.title('Average Delay Distribution')
plt.xlabel('Average Delay (minutes)')


if __name__ == '__main__':
main()
38 changes: 38 additions & 0 deletions .history/Analyze_20240207183332.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#RESOLVED
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np


def import_data():
"""
Import data from the TTC Bus Delay dataset
"""
return pd.read_csv('ttc-bus-delay-data-2023.csv')


def compute_avg_delay(data, group_by: str = 'Route'):
"""
Compute the average delay aggregated by specified column
"""
<<<<<<< HEAD
return data.groupby('Route')['Min Delay'].mean().reset_index()
=======
return data.groupby(group_by).mean().reset_index()
>>>>>>> origin/feature1


def main():
"""
Main function
"""
data = import_data()
avg_delay = compute_avg_delay(data, group_by='Route')

plt.hist(avg_delay['Min Delay'], bins=30)
plt.title('Average Delay Distribution')
plt.xlabel('Average Delay (minutes)')


if __name__ == '__main__':
main()
38 changes: 38 additions & 0 deletions .history/Analyze_20240207183335.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#RESOLVED FIXED
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np


def import_data():
"""
Import data from the TTC Bus Delay dataset
"""
return pd.read_csv('ttc-bus-delay-data-2023.csv')


def compute_avg_delay(data, group_by: str = 'Route'):
"""
Compute the average delay aggregated by specified column
"""
<<<<<<< HEAD
return data.groupby('Route')['Min Delay'].mean().reset_index()
=======
return data.groupby(group_by).mean().reset_index()
>>>>>>> origin/feature1


def main():
"""
Main function
"""
data = import_data()
avg_delay = compute_avg_delay(data, group_by='Route')

plt.hist(avg_delay['Min Delay'], bins=30)
plt.title('Average Delay Distribution')
plt.xlabel('Average Delay (minutes)')


if __name__ == '__main__':
main()
33 changes: 33 additions & 0 deletions .history/Analyze_20240211193044.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np


def import_data():
"""
Import data from the TTC Bus Delay dataset
"""
return pd.read_csv('ttc-bus-delay-data-2023.csv')


def compute_avg_delay(data):
"""
Compute the average delay for each route
"""
return data.groupby('Route').mean().reset_index()


def main():
"""
Main function
"""
data = import_data()
avg_delay = compute_avg_delay(data)

plt.hist(avg_delay['Min Delay'], bins=30)
plt.title('Average Delay Distribution')
plt.xlabel('Average Delay (minutes)')


if __name__ == '__main__':
main()
34 changes: 34 additions & 0 deletions .history/Analyze_20240211195121.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np


def import_data():
"""
Import data from the TTC Bus Delay dataset
"""
return pd.read_csv('ttc-bus-delay-data-2023.csv')


def compute_avg_delay(data):
"""
Compute the average delay for each route
"""
return data.groupby('Route')['Min Delay'].mean().reset_index()


def main():
"""
Main function
"""
data = import_data()
avg_delay = compute_avg_delay(data)

plt.hist(avg_delay['Min Delay'], bins=30)
plt.title('Average Delay Distribution')
plt.xlabel('Average Delay (minutes)')
plt.show()


if __name__ == '__main__':
main()
34 changes: 34 additions & 0 deletions .history/Analyze_20240211195122.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np


def import_data():
"""
Import data from the TTC Bus Delay dataset
"""
return pd.read_csv('ttc-bus-delay-data-2023.csv')


def compute_avg_delay(data):
"""
Compute the average delay for each route
"""
return data.groupby('Route')['Min Delay'].mean().reset_index()


def main():
"""
Main function
"""
data = import_data()
avg_delay = compute_avg_delay(data)

plt.hist(avg_delay['Min Delay'], bins=30)
plt.title('Average Delay Distribution')
plt.xlabel('Average Delay (minutes)')
plt.show()


if __name__ == '__main__':
main()
34 changes: 34 additions & 0 deletions .history/Analyze_20240211195123.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np


def import_data():
"""
Import data from the TTC Bus Delay dataset
"""
return pd.read_csv('ttc-bus-delay-data-2023.csv')


def compute_avg_delay(data):
"""
Compute the average delay for each route
"""
return data.groupby('Route')['Min Delay'].mean().reset_index()


def main():
"""
Main function
"""
data = import_data()
avg_delay = compute_avg_delay(data)

plt.hist(avg_delay['Min Delay'], bins=30)
plt.title('Average Delay Distribution')
plt.xlabel('Average Delay (minutes)')
plt.show()


if __name__ == '__main__':
main()
34 changes: 34 additions & 0 deletions .history/Analyze_20240211195125.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np


def import_data():
"""
Import data from the TTC Bus Delay dataset
"""
return pd.read_csv('ttc-bus-delay-data-2023.csv')


def compute_avg_delay(data):
"""
Compute the average delay for each route
"""
return data.groupby('Route')['Min Delay'].mean().reset_index()


def main():
"""
Main function
"""
data = import_data()
avg_delay = compute_avg_delay(data)

plt.hist(avg_delay['Min Delay'], bins=30)
plt.title('Average Delay Distribution')
plt.xlabel('Average Delay (minutes)')
plt.show()


if __name__ == '__main__':
main()
43 changes: 43 additions & 0 deletions .history/Analyze_20240211225832.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# FIXED AND TESTED PYTHON CODE
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np


def import_data():
"""
Import data from the TTC Bus Delay dataset
"""
return pd.read_csv('ttc-bus-delay-data-2023.csv')


def compute_avg_delay(data, group_by: str = 'Route'):
"""
Compute the average delay aggregated by specified column
"""


return data.groupby('Route')['Min Delay'].mean().reset_index()

return data.groupby(group_by).mean().reset_index()


return data.groupby('Route')['Min Delay'].mean().reset_index()



def main():
"""
Main function
"""
data = import_data()
avg_delay = compute_avg_delay(data, group_by='Route')

plt.hist(avg_delay['Min Delay'], bins=30)
plt.title('Average Delay Distribution')
plt.xlabel('Average Delay (minutes)')
plt.show()


if __name__ == '__main__':
main()
Loading