Loading tutorials
.loc, .iloc, boolean masks, and query, works on these parts. If you can name them and predict what each one holds, the later rules are easier to learn.7 min readpd. It also assumes you know that a DataFrame has an index, columns, and values. If the difference between an index label and a column name is unclear, rev5 min read.loc is the label-based selector in pandas. It takes a row selector and an optional column selector in one pair of square brackets. This chapter covers what .loc accepts, what shape of result you get back, how its slices behave, and the errors you are most likely to hit.5 min read.loc, because .iloc is easiest to learn by comparing the two.4 min readpd. It also assumes you know basic Python comparisons and the difference between a label and a position. The examples reuse the df of five cities built in the first chapter.5 min readdf["population_k"] > 3000 and use it to filter rows. Here you will combine several masks into one filter. You will also see why Python's and, or, and not don't work on masks and what goes wrong when parentheses are missing.4 min readdf["population_k"] > 3000. It also assumes you know how to combine masks with &, |, and ~. Here you will learn three families of helpers that build masks for you: isin, between, and the .str accessor. They replace long chains of4 min read&, | and ~, and use .loc for selection. It covers why missing values behave differently from other values in a filter, and which tools to use for them.5 min read&, |, ~, isin, and between. If those are unfamiliar, review the earlier chapters on masks first. Here you will write the same filters as strings with DataFrame.query, learn where t4 min readdf[["city", "population_k"]]. That stops working when a table has dozens of columns, or when you want "every numeric column" or "every column that starts with price_". This chapter covers two tools for those cases, `DataFrame.sele4 min read.loc, .iloc, and boolean masks from the earlier chapters. It also assumes you have pandas installed and imported as pd. Here you will learn how to write values back into a DataFrame through a selection. You will5 min read.loc and .iloc work, how boolean masks filter rows, and what a DataFrame's index, columns, and values are.5 min read.at and .iat. It assumes you have read the earlier chapters on .loc, .iloc, and set_index. You should know that .loc works on labels and .iloc works on positions.5 min read