Programming
Programming
Programming
1
Answer 1 — Source Code (No AI Tool Was Used)
import pandas as pd
import matplotlib.pyplot as plt
file_name = get_valid_file_name()
# Read CSV file into a dataframe and display it has been loaded
try:
df = pd.read_csv(file_name)
print("CSV file has been successfully loaded.")
2
# Count number of customers in each age category
age_category_counts = data['Age Category'].value_counts()
3
except FileNotFoundError:
print("File not found. Please make sure the file exists and try
again.")
Answer 1 — Output
4
Transforming Customer Insights into Actionable Strategies for ‘Next Gen Automotive’
Knowing and understanding customer needs is key and centric to any successful business
model. The entrenchment of this customer-first mentality ensures retaining existing ones
while minimizing the costs of new acquisitions (Charles, 2021). However, before we
anticipate customer needs it is important to gain insights into who the customers are and the
most effective way of making the product available to them (Grow, 2015). The ability to learn
is an organization's only sustainable source of competitive advantage. In practice, this
means the capability of translating data about customers into customer preference and
hence shareholder value (Smith et al., 2006). Therefore, today firms with superior data-to-
value capacity are the ones that lead. As we have established that customer insights are an
integral part of a firm’s brand building process; ‘Next Gen Automotive’ being a small
business can make use of transforming their customer data into actionable insights. The
three key business insights I have generated demonstrate a few ways the company can
derive value from knowing their customers. In addition, the recommendations provided from
the business insights point the business in the right direction to start the process of
segmenting their customer further and targeting them effectively.
1. Business Insight One — Most Customers are in the USA and Germany
The bar graph in Figure 1 illustrates the distribution of customers based on their country of
origin. It is evident that the United States (USA) and Germany stand out as key areas of
opportunity for Next Gen Automotive's long-term growth strategy. This insight is pivotal for
Next Gen as it enables them to identify regions with significant customer concentration,
highlighting areas for potential expansion and investment.
Given that Next Gen is a small business and the need to allocate resources effectively, it
may be worthwhile for the company consider divesting from regions with lower customer
engagement. These regions, including South Africa, Poland, Spain, Switzerland, Bulgaria,
and Sri Lanka, collectively represent less than 0.04% of total sales. By reallocating
resources from these less active markets, Next Gen can focus its efforts on maximizing
returns in regions with greater growth potential.
5
2. Business Insight Two — Most Cars Sold are Petrol based
Figure 4
Considering that Next Gen focus on long-term growth within the US and Germany and
based on the insights, it seems that the company should strategically consider expanding its
electric and hybrid car offerings to better align with future consumer preferences, especially
in the US. Given the anticipated shift in the coming years, tapping into this growing demand
could be a lucrative opportunity. Focusing on marketing existing alternative fuel cars in
inventory and their benefits, in Germany where there's already a higher adoption rate, Next
Gen could capture a new customer segment and larger market share. Hence this business
insight is instrumental in recognising a lapse in meeting existing and increasing consumer
needs for electric vehicles in two regions where most of Next Gen’s customers are located.
6
3. Business Insight Three — Most customers are Millennials
The bar graph above segments customers by age and into their respective generations.
More particularly, ages 12-27 have been categorised as Gen Z; 28-43 into Millennials; 44-59
into Gen X; 60-78 into Boomers and 79-96 into Post War (Beresford Research, no date). As
can be seen above in Figure 5, most of Next Gen Automotive’s customers are Millennials
making approximately 40.66% of total customers. This business insight can help Next Gen
segment its customers for targeted marketing strategies. Segmenting customers by age and
generation is crucial for businesses that want to effectively reach and engage with their
target audience. This is because each generation has different needs, preferences, and
behaviours, and a one-size-fits-all approach is not enough in today's competitive
marketplace (Mehta, 2023). Below are some recommendations for targeted marketing
initiatives towards Millennials that the company can make use of.
7
leasing a new car should take less time and 23% of Millennials won’t wait longer than 10
minutes for a test drive. Hence, millennials come from an era of high customer experience
and expect the same. To address the same, Next Gen Automotives should focus on fast
customer service by investing in trained in-store staff and services such as express test
drives and insurance sign ups. Lastly, as seen in Figure 6, 24% of Millennials believe their
generation is unique through their use of technology. Effective integration of in-store and
online channels would hence be appreciated while investment in a Mobile App would ensure
fast and convenient service for the ‘creatures of habit’ that are millennials (Jazel Auto
Marketing, no date).
8
Answer 2 — Source Code (No AI Tool Was Used)
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
# Extract only year from data frame 2 and store it in a similar column
df2['Release_Year'] = pd.to_datetime(df2['Release_Date']).dt.year
# Explode the 'Genres' column so that each genre has its own row
df_exploded = df_final.explode('Genres')
# List of years
years_to_plot = [2018, 2019, 2020, 2021, 2022]
9
# Define a color palette with a unique color for each genre
genre_palette = sns.color_palette('Set3',
n_colors=len(genre_counts_by_year.columns))
Answer 2 — Output
10
Figure 8: Number of Movies Released by Genre in 2019
11
Figure 10: Number of Movies Released by Genre in 2021
12
After that, I extracted the year from the second data frame and stored it in a similar column
as the first data frame. This was because the second data frame listed Release Dates in
dd/mm/yy format when I just wanted the year for analysis. Next, I joined the two data frames
on the 'Title' column using the concat() function from pandas. Afterwards, I removed
duplicate rows and irrelevant columns from the combined data frame. Then, I split the
combined genres into individual genres and used the explode function so that each genre
had its own row. Finally, I created a pivot table to count the number of movies by genre and
year. This process involved using various Python libraries such as pandas, seaborn, and
matplotlib.
The Feature
The app offers flexible tickets wherein if the specified time for train booked is missed,
customers can take the next trains in the same day. However, the new train they take after
the missed one must meet conditions such as:
The train must pass through a specific station
The train must be offered by the same train operator
The departure and arrival stations must remain the same
Customers who miss their trains must initiate a search on the app again and manually look
for trains that meet the conditions of their missed trains. This can be frustrating and time
consuming while the customer figures out the next best train to travel on. Hence, I suggest a
feature that once the train departs prompts the user to enter whether they have boarded or
not. If they click no, trainline will then suggest them the next best train to take that meets the
13
conditions of their old train (specific above) and recommends the one that takes the shortest
time.
Use of Agile Methodology
To implement this feature using Agile methodology, developers would need to break down
the project into smaller, manageable tasks and iteratively develop and testing them in short
sprints. Potential sprints could include:
1. Gathering Requirements through User Stories and Set Acceptance Criterion (1-2
weeks)
o Work with customer to research pain points through User Stories and detail essential
feature required
o Define conditions and logic to evaluate and suggest the next best train
o Develop an acceptance criterion based on the above and review and prioritise with
product owner and team
2. Designing and Prototyping (2-3 weeks)
o Create mock-ups and wireframes of the user interface
o Develop prototypes for user testing
o Conduct user testing and refine the design and prototype based on user feedback
o Review the changes and design with the product owner and team
3. Development and Testing Against Acceptance Criteria (3-4 weeks)
4. Deployment (1-2 weeks)
o Integrate new feature into the Trainline app, first as a beta testing feature
o Monitor user feedback and usage metrics
o Address issues or bugs arising after deployment
5. Maintenance and Improvement (Ongoing)
o Plan and prioritize future iterations
o Continuously improve based on user feedback and data analysis
The product owner here is responsible for prioritising product backlog (list of features,
requirements, and user stories) and envisions the product and strategy as the voice of the
customer, ensuring the project meets customer’s needs.
14
Business Value for Trainline
Implementing this suggested feature for Trainline would significantly enhance the overall
customer experience by providing a seamless solution to the problem of missed trains.
Additionally, by doing so trainline as a technology platform would be able to display its
commitment to constant innovation and customer satisfaction. The facilitation of automating
the process of finding the next best train would also reduce the burden on customer support,
allowing them to focus on more complex inquiries. Lastly, the feature has great potential to
boost trainline’s sales as it offers them the opportunity to capture customer that might have
been lost due to the inconvenience of manually searching for train alternatives.
15
Reference List
1. Barker, T. (2015). 11 Facts That Will Make You Feel Even More Emotionally Glued To
Your Car. [online] MTV. Available at: https://www.mtv.com/news/31x50f/emotional-bond-
cars-millennials-study [Accessed 1 May 2024].
2. Beresford Research (2024). Age Range by Generation. [online] Beresford Research.
Available at: https://www.beresfordresearch.com/age-range-by-generation/.
3. Business Research Insights (2024). Comedy Film Market Growth, Size, Share and
Forecast [2027]. [online] www.businessresearchinsights.com. Available at:
https://www.businessresearchinsights.com/market-reports/comedy-film-market-108267.
4. Coe, N. (2016). Market Report Auto Trader. [online] Available at:
https://plc.autotrader.co.uk/media/kligt2av/market-report-sept-2016_090916.pdf
[Accessed 30 Apr. 2024].
5. International Energy Agency (2023). Global EV Data Explorer – Data Tools. [online] IEA.
Available at: https://www.iea.org/data-and-statistics/data-tools/global-ev-data-explorer.
6. Jamaal Ewing (2015). The Importance of Knowing Your Customer. [online] Grow.
Available at: https://growbusiness.org/2015/07/the-importance-of-knowing-your-
customer/.
7. Jenkins, T. (2017). The Best Marketing Techniques to Reach Your Millennial Audience.
[online] CBT News. Available at: https://www.cbtnews.com/the-best-marketing-
techniques-to-reach-your-millennial-audience-2/ [Accessed 30 Apr. 2024].
8. Marshall, J., Velasquez-Rose, S., Alcantar, E. and Clay, D. (2024). The Road to Clean
How to message electric vehicles in a charged environment. [online] Available at:
https://potentialenergycoalition.org/wp-content/uploads/2024/03/EV-Report.pdf
[Accessed 30 Apr. 2024].
9. Mehta, J. (2023). The benefits of segmenting customers by age and generation. [online]
abmatic.ai. Available at: https://abmatic.ai/blog/benefits-of-segmenting-customers-by-
age-and-generation#:~:text=Some%20of%20the%20key%20benefits%20of
%20segmenting%20customers%20by%20age [Accessed 30 Apr. 2024].
10. Pew Research Center. (2010). Millennials: Confident. Connected. Open to Change.
[online] Available at: https://www.pewresearch.org/social-trends/2010/02/24/millennials-
confident-connected-open-to-change/#:~:text=Most%20Millennials%20(61%25)%20in
[Accessed 1 May 2024].
11. Ritchie, H. (2024). What do Americans think about electric cars? [online]
www.sustainabilitybynumbers.com. Available at:
https://www.sustainabilitybynumbers.com/p/american-attitudes-ev#footnote-anchor-1-
143703245 [Accessed 30 Apr. 2024].
16
12. Smith, B., Wilson, H. and Clark, M. (2006). Creating and using customer insight: 12
Rules of best practice. Journal of Medical Marketing, 6(2), pp.135–139.
doi:https://doi.org/10.1057/palgrave.jmm.5050013.
13. Tsai, C.-F., Hu, Y.-H. and Lu, Y.-H. (2013). Customer segmentation issues and
strategies for an automobile dealership with two clustering techniques. Expert Systems,
32(1), pp.65–76. doi:https://doi.org/10.1111/exsy.12056.
17