I'd say that's because df[start:stop] mimics python's builtin list slicing, which includes start but excludes end, so this dictates the behaviour of indexing without .loc. By contrast, df.loc[start:stop] is a label-based indexer, and labels can be anything (integers, strings, datetimes, categories, etc.), so it doesn't always make sense to exclude the right endpoint of the interval.
There are some things which Pandas is just better at, such as: extracting content via RegEx and pivoting... However, there are also some situations where you should use SQL such as UPSERT or date-range joins.
11 comments
[ 3.8 ms ] story [ 36.9 ms ] threadIs this useful for the analysis of such data (with a machine learning mid term goal (clustering and anomaly detection)?
Did you mean linear regression? Linear optimization isn't a use case that Pandas covers, but there are other tools that I can recommend.
Is it? How so?