We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 831d29d commit 07125eaCopy full SHA for 07125ea
doc/source/user_guide/migration-3-strings.rst
@@ -195,6 +195,18 @@ This is actually compatible with pandas 2.x as well, since in pandas < 3,
195
of also stringifying missing values in pandas 2.x. See the section
196
:ref:`string_migration_guide-astype_str` for more details.
197
198
+For selecting string columns with :meth:`~DataFrame.select_dtypes` in a pandas
199
+2.x and 3.x compatible way, it is not possible to use ``"str"``. While this
200
+works for pandas 3.x, it raises an error in pandas 2.x.
201
+As an alternative, you can select both ``object`` (for pandas 2.x) and
202
+``"string"`` (for pandas 3.x; which will also select the default ``str`` dtype
203
+and does not error on pandas 2.x):
204
+
205
+.. code-block:: python
206
207
+ # can use ``include=["str"]`` for pandas >= 3
208
+ >>> df.select_dtypes(include=["object", "string"])
209
210
211
The missing value sentinel is now always NaN
212
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
AltStyle によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル
0 commit comments