Loading tutorials
DataFrame or Series. You should also have read a CSV file with pd.read_csv. Later chapters in this tutorial fix the problems you find here. This one only teaches you to see them.3 min readpd.read_csv. It explains why a column that looks numeric or date-like is stored as text, so you know what to fix before you convert anything.3 min readdf.dtypes. You will learn to use astype, the basic tool for changing a column's dtype. You will also learn where it stops working and which tool to reach for next.2 min readobject or string dtype.2 min readdf.dtypes. You should also know that text-based columns have dtype object (or string).2 min readobject dtype and pd.to_numeric. Here you will turn date text into real datetime64 values, and handle strings that do not parse.2 min readpd.to_numeric and pd.to_datetime as shown in the earlier chapters.2 min readpd.to_numeric and astype as shown earlier in this tutorial. It covers what happens to an integer column when it contains missing values, and how nullable dtypes avoid the problem.3 min read.str accessor, and read a column's dtype. Survey and export files often store answers like "yes" and "no" as text. Text answers can't be used directly as filters or counted with sum(). A boolean column fixes that.2 min readdf.dtypes, and convert a column with astype. It covers the category dtype, which suits columns where a small set of labels repeats many times.3 min readpd.read_csv, and that you know the astype, pd.to_numeric and pd.to_datetime conversions from earlier chapters. Here you will move those conversions into the load step, so the DataFrame has the right types from the start.2 min readdf.dtypes, convert with astype and pd.to_numeric, and know what Int64 and boolean are. DataFrame.convert_dtypes() is a shortcut that moves columns to the nullable dtypes you saw earlier in one call.2 min readdf.dtypes, and convert columns with pd.to_numeric and astype. Here you will measure how much memory a column uses, then shrink it with downcasting and the category dtype.2 min read