3 ms·
It's not actually. You never call dunder methods directly, you use them through the built-in function or operator. So it can be neither myvar.len() nor myvar.__
by drexlspivey 8y ago
It's not actually. You never call dunder methods directly, you use them through the built-in function or operator. So it can be neither myvar.len() nor myvar.__len__
- bobbylarrybobby 8y agoWell, x.__len__() is the same as len(x). You’re just supposed to remember not to use it (makes you wonder why they chose len(x) instead of x.len())
- goatlover 8y agoor x.length, since length should be a property like it is in Ruby and JS. In Pandas, a DataFrame's shape is a property and not a function or method.