Loading tutorials
df.columns, what kinds of problems to look for, and how to spot them with code instead o4 min readdf.columns. Here you change some of those labels and leave the rest alone.4 min readrename() so that pandas rewrites every column label in one step. It assumes you can build a DataFrame, call df.rename(columns={...}) with a dictionary, and write a short Python function that uses string methods such as strip and lower.5 min readdf.columns, and the related set_axis() method. It assumes you can create a DataFrame and select columns by label. It also assumes you know basic Python lists, dictionaries, and functions. You should have seen rename() with a dictionary from4 min readdf.columns. It also assumes you know rename() with a dictionary, plus Python string methods such as strip and lower. Here you will turn arbitrary column labels into consistent snake_case names in one step. You will use the .str acce4 min readrename() calls. Most of them fail silently, so the code runs and the labels are wrong. It assumes you can build a DataFrame, select columns by label, and use dictionaries. It also assumes you know the rename() forms from earlier chapters: `c4 min readstrip and lower. It defines "duplicate" precisely, because every later step (flagging, dropping, keeping the latest record) depends on that definitio5 min readSeries of True and False values can select rows. The previous chapter defined a duplicate row as one whose values match an earlier row across the co5 min readduplicated() returns one True or False per row. Here you will use drop_duplicates() to remove repeated rows and learn how it decides what counts as a repeat.5 min readduplicated() and drop_duplicates() treat as a duplicate and which row survives. It assumes you can build a DataFrame, select columns by label, and read a boolean mask. It also assumes you have seen drop_duplicates() called with no arguments.4 min readloc and iloc, and have read the earlier chapters on duplicated(), drop_duplicates(), subset and keep. It covers what drop_duplicates() does to the row labels, what that breaks, and how to handle it.4 min readdrop_duplicates() with its subset and keep options, and basic sorting with sort_values(). It also assumes you can convert text to dates with pd.to_datetime().4 min readduplicated() and drop_duplicates() with subset and keep. It also assumes you are comfortable with the .str accessor from the label-cleaning chapters. Here you will see why exact comparison misses duplicates that a person would spot at once, and how 5 min readdf.columns, rename(), and duplicated() work from the earlier chapters. You should also be comfortable with Boolean masks and loc. Here we apply those tools to a related problem: two or more columns that share the same label.4 min readrename() ignores keys that match nothing, and drop_duplicates() removes whatever it considers a duplicate, which may not be what you meant. This chapter covers checks you can run after each step.4 min read