After the Python drop function, the object type changes to nonetype.

Asked 2 years ago, Updated 2 years ago, 16 views

train = train.drop(['PassengerId', 'Name', 'Ticket'], axis=1, inplace=True)

If you type (train) before and after this function, It's changed from DataFrame to NoneType.

How do I do this? I don't know anything about Python.

python

2022-09-20 18:08

1 Answers

inplace=True Please check the Pandas document for the meaning of the factor. The first thing a beginner will learn is how to find and check documents.

https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.drop.html


2022-09-20 18:08

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.