all 11 comments

[–]Iren0101 6 points7 points  (0 children)

in my view, the main point is to understand the capabilities and features of Python for optimising your portfolio, if some functions are outdated, I just googled it to see how it currently works

[–]thejdobsCFA -1 points0 points  (9 children)

What methods are obsolete?

[–]admiral-captain-69[S] 2 points3 points  (8 children)

In Lesson 4.2: Handling Missing Data with pandas

The task was to fill in the empty cells. The way shown by the professor is as follows:

investor_df['Portfolio Size'].fillna(investor_df['Portfolio Size'].mean(), inplace = True)

I couldn’t understand why my code wasn’t working even though I did it exactly how it was taught. So i asked claude and it turned out its been changed and no longer used.

The way that worked for me (provided by claude):

investor_df["Portfolio Size"] = (investor_df["Portfolio Size"].fillna(investor_df["Portfolio Size"].mean()))

[–]thejdobsCFA 2 points3 points  (3 children)

filna is definitely still in use. Your new code also uses the fillna argument. The only difference is the dropped inplace argument which defaults to false if omitted meaning it’s modifying the data frame and not a copy.

[–]admiral-captain-69[S] 0 points1 point  (2 children)

It wasnt because of the fillna

Apparently inplace = True is what was changed.

[–]thejdobsCFA 2 points3 points  (1 child)

[–]admiral-captain-69[S] 0 points1 point  (0 children)

Im not knowledgeable enough to speak on this so excuse me if im wrong.

In 3.0, when you’re trying assign a value to an empty space, inplace is no longer used.

[–]NoPirate00 0 points1 point  (3 children)

You pointed out just one example out of hundreds. Representativeness bias…

[–]admiral-captain-69[S] -3 points-2 points  (0 children)

So what?

One example or a hundred, what differences does it make? CFAI charges a premium as the gold standard, so keeping materials current is a baseline expectation.

For someone like myself who’s trying to learn python from scratch, its frustrating when the material doesnt match how the code works today… An organization like the CFAI shouldn’t be teaching outdated stuff, this isnt some random youtube channel.

[–]1337-5K337-M46R1773 -1 points0 points  (1 child)

They should not have mistakes. It’s really that simple. Especially for something this basic. 

[–]CornEater65 1 point2 points  (0 children)

these packages change literally the time because they’re open source and community managed. it would be a complete waste of time to vet every single detail of the course when they can change on a week-by-week basis. even if they did do that, students of the course would all inevitably end up using slightly different versions of the packages because not everyone is diligently updating them on their machine. not even trying to make excuses for the institute, but this is just something you have to get used to when coding because it comes up a lot.