-
Book Overview & Buying
-
Table Of Contents
Learning Pandas
By :
Elements of an array or Series are selected using the [] operator. DataFrame overloads [] to select columns instead of rows, except for a specific case of slicing. Therefore, most operations of selection of one or more rows in a DataFrame, require alternate methods to using [].
Understanding this is important in pandas, as it is a common mistake is try and select rows using [] due to familiarity with other languages or data structures. When doing so, errors are often received, and can often be difficult to diagnose without realizing [] is working along a completely different axis than with a Series object.
Row selection using the index on a DataFrame then breaks down to the following general categories of operations:
Slicing using the [] operator
Label or location based lookup using .loc, .iloc, and .ix
Scalar lookup by label or location using .at and .iat
We will briefly examine each of these techniques and attributes. Remember, all of...
Change the font size
Change margin width
Change background colour