SelwynChan / HelloWorld

My first Git Repository
0 stars 0 forks source link

Dates #20

Open SelwynChan opened 1 year ago

SelwynChan commented 1 year ago

You can implement this function using the pandas library in Python. Here's a sample implementation:

import pandas as pd

def filter_dataframe(df, start_date):
    # Convert 'dateModified' to pandas datetime format if necessary
    if df['dateModified'].dtype != 'datetime64[ns]':
        df['dateModified'] = pd.to_datetime(df['dateModified'])

    # Filter rows with dateModified before the start_date
    before_start_date = df[df['dateModified'] < start_date]

    # Find the most recent dateModified before the start_date for each accountID
    most_recent_before_start_date = before_start_date.groupby('accountID')['dateModified'].max().reset_index()

    # Merge the most recent dateModified with the original dataframe
    result_before_start_date = pd.merge(most_recent_before_start_date, before_start_date, on=['accountID', 'dateModified'])

    # Filter rows with dateModified equal to or after the start_date
    after_start_date = df[df['dateModified'] >= start_date]

    # Combine the two filtered dataframes
    result = pd.concat([result_before_start_date, after_start_date], ignore_index=True)

    return result

# Example usage
# Assuming 'data' is a pandas dataframe with columns 'dateModified' and 'accountID'
start_date = pd.to_datetime('2021-01-01')
filtered_data = filter_dataframe(data, start_date)

This function first filters the dataframe to only include rows with dateModified before the start_date. It then finds the most recent dateModified for each accountID and merges this information with the original dataframe to get the filtered result with the most recent dateModified before the start_date. The function also filters the rows with dateModified equal to or after the start_date. Finally, it combines these two filtered dataframes to get the final result.

SelwynChan commented 8 months ago

Introductory Speech

Good morning everyone,

I am delighted to stand before you today as a Managing Director of Goldman Sachs Engineering division, but more importantly, as an advocate for women in technology. I want to extend a warm welcome to each and every one of you. Your presence here today symbolizes your curiosity and your willingness to explore new horizons. To me, that's not just admirable, it's inspiring.

Today, we have joined hands with the Women’s Foundation to provide you with a unique opportunity to dive into the exciting world of technology. Our aim is simple: we want to ignite a passion within you for technology, to help you understand its power and potential, and to encourage you to envision yourselves as future innovators, creators, and leaders.

Now, I believe you've already been introduced to the Raspberry Pi. This tiny piece of hardware, not much bigger than a credit card, is a powerful tool that can do tasks as simple as your homework or as complex as controlling a robot. And Python? It's one of the most popular programming languages in the world, used by startups and tech giants alike. Today, you'll get to combine the two and see what magic you can create!

Here at Goldman Sachs, technology is not just a department, it's a vital part of everything we do. Our engineers work tirelessly, using programming languages like Python, to develop innovative solutions that drive our business forward. They build systems that power the global economy, create tools that help us make better decisions, and design platforms that connect us with clients around the world.

Why is this important? Because finance, like many other sectors, is being significantly transformed by technology. Understanding how to leverage technology is no longer a 'nice-to-have', it's a 'must-have'. It's not just about coding, it's about problem-solving, creativity, and making a real impact on the world.

But let's be honest, the tech industry can be daunting. It's a field where, historically, women have been underrepresented. But things are changing, and you are part of that change. By being here today, you are taking a step towards breaking barriers and reshaping the future of technology.

Today is about you. It's about learning, discovering, creating, and most importantly, having fun. You'll work alongside our engineers, who are eager to share their experience and knowledge, and help you navigate through your tasks. Don't hesitate to ask questions, make mistakes, and push boundaries. Remember, every great innovator started out as a beginner.

I am incredibly excited to see what you will create today. Remember, this day is not about getting everything perfect but about exploring, learning, and growing. Enjoy your day, take advantage of this opportunity, and remember - the future of technology is in your hands.

Welcome to Goldman Sachs, and welcome to your future.

SelwynChan commented 8 months ago

Talking Points for Introductory Speech

  1. Warm Welcome: Begin with a warm welcome, express admiration for their curiosity and willingness to explore new horizons.

  2. Objective: Explain the aim of the event - to ignite a passion within them for technology, help them understand its power and potential, and encourage them to envision themselves as future innovators, creators, and leaders.

  3. Raspberry Pi and Python: Introduce the Raspberry Pi and Python, highlighting how these tools are used in real-world applications.

  4. Role of Technology in Goldman Sachs: Emphasize the vital role of technology in Goldman Sachs - how engineers work to develop innovative solutions that drive the business forward.

  5. Importance of Tech Skills: Stress the importance of tech skills in today's world - they're essential for problem-solving, creativity, and making a real impact.

  6. Women in Tech: Acknowledge the underrepresentation of women in tech, but highlight how things are changing and that they are part of that change.

  7. Today's Event: Reinforce that today is about learning, discovering, creating, and having fun. Encourage them to ask questions, make mistakes, and push boundaries.

  8. Closing Remarks: Close with excitement for the day, reminding them that the day is about exploring, learning, and growing. Welcome them to their future.

SelwynChan commented 8 months ago

Introductory Speech

Hey everyone,

So, here I am, a Managing Director at Goldman Sachs Engineering division. But, more than that, I'm someone who's super passionate about getting more girls and women into tech. So it's awesome to see you all here today. Your curiosity and eagerness to learn new things is seriously cool.

We've teamed up with the Women’s Foundation to give you a taste of the tech world. What we're hoping to do today is simple: we want to get you fired up about tech, show you what it can do, and get you thinking about how you could be the ones driving the tech world forward in the future.

You've probably heard about the Raspberry Pi by now. This thing is tiny - not much bigger than a credit card - but don't let the size fool you. It's a beast that can do anything from sorting out your homework to controlling a robot. And Python? It's a coding language that's loved by everyone from small startups to massive tech companies. Today, you'll get the chance to bring these two together and see what you can cook up!

Here at Goldman Sachs, tech isn't just a department on the side; it's at the heart of everything we do. Our engineers are always working with languages like Python, creating cutting-edge solutions that keep us moving forward. They're building the systems that keep the global economy ticking, making tools that help us make smarter decisions, and designing platforms to connect us with clients worldwide.

Why should you care? Well, finance, like pretty much everything else these days, is getting a serious tech makeover. Knowing how to use tech isn't just a bonus anymore, it's a must. And it's not just about coding, it's about problem-solving, being creative, and making a real difference in the world.

Now, I won't sugar-coat it, the tech world can be a bit intimidating, and historically, it's been a bit of a boys' club. But that's changing, and you guys are a part of that change. Just by showing up today, you're taking a step towards smashing those old stereotypes and shaping the future of tech.

So, today is all about you. It's about learning new stuff, discovering what you're capable of, and - most importantly - having a good time while doing it. You'll be working with our engineers, and they're just as keen as I am to share what they know and help you get the hang of things. So don't be shy. Ask questions, make mistakes, and push your limits. Remember, nobody starts out as an expert.

I can't wait to see what you all come up with today. Just keep in mind, today isn't about being perfect. It's about exploring, learning, and growing. So, enjoy your day, make the most of this opportunity, and remember - the future of tech could very well be in your hands.

So, welcome to Goldman Sachs, and to what could be the start of your tech journey. Let's get started.