Loading tutorials
object columns since its first releases. An object column holds any Python value, so it holds text, but it also holds a lot of other things. This chapter explains what that costs you in correctness, clarity, and memory. The costs are the reason the dedicated string dt6 min readStringDtype, the dedicated text type in pandas. It assumes you know basic Python strings, how to create and index a Series or DataFrame, and what a dtype is. Later chapters cover missing values, the .str accessor, conversion strategies, and storage backends in depth. Here6 min readobject and string columns, and what happens to missing entries when you use .str methods, comparisons, and filters. It assumes you can create Series and DataFrames, know what a dtype is, and hav6 min readstring dtype and the idea of pd.NA from the earlier chapters. Regular expressions 6 min read.str methods accept a pattern. Depending on the method, that pattern is either plain text or a regular expression. If you assume the wrong one, you get silent wrong answers, such as a . that matches every character, or an error on a pattern like c++. This chapter shows which methods use w6 min readstring dtype and the .str accessor from earlier chapters. The examples use pandas 2.x with dtype="string". They behave the same under the d6 min readobject to the string dtype. It assumes you know what a dtype is, can build and index a Series or DataFrame, and have met the string dtype and pd.NA in earlier chapters. The examples were written for pandas 2.5 min readdtype="string" and pd.NA in the earlier chapters. Here you learn what "storage" means for the string dtype, how the two backends differ, and how to choose one.6 min readobject, string with the python backend, string with the pyarrow backend, and category using your own data.6 min readstring dtype is the right default for text, but some text columns hold only a handful of distinct values repeated many times. Country codes, order statuses, and product tiers are examples. For these columns the category dtype can use far less memory and speed up grouping. This chapter explai6 min readstring dtype, the .str accessor, and how pd.NA behaves in text columns. It also assumes you have seen the python and pyarrow storage backends from earlier chapters. It covers what changes in pandas 3, where the new dtype differs from string, and how to p7 min readstring dtype, the .str accessor, pd.NA, and basic regular exp7 min read