Here is the example of my data set from some public transports: data set.
Date is from 2018-06-01 to 2018-06-30,
Time is operation hours, from 5am to 24(0)am,
People is the number of peope in that specific date, time and trip.
from_to is the where those people enter and leave (one type of trips),
and finally weekday.
What I need to do here is to create a time table for each trip, for example if I want to create a table for trip "G1_G2", the code I use now is:
for i in [0,1,2,3,4,5,6]:
for j in [0,1,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23]:
df['people'][(df['weekday'] == i)&(df['from_to'] == 'G1_G2') & (df['time'] == j)].mean()
Where "i" is weekday, and j is the operating hours. The result will be a table like: output table
But the problem here is that each table will take about 10 seconds to create, there are around 11,000 types of trip here, which will take 30 something hours.
Is there other ways to do this with higher efficiency using python?
Thanks in adanvance!
JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)