TypeError: drop() got an unexpected keyword argument ‘columns’
train.drop(columns=["Unnamed: 0"], inplace=True)
test.drop(columns=["Unnamed: 0"], inplace=True)
The reason for the above error is that pandas only added the columns keyword in version 0.21, but not in 0.20.
Solution:
upgrade panda package
pip install --upgrade pandas
View panda version
print (pd.__version__)
Read More:
- python got an unexpected keyword argument
- Python TypeError: ‘newline’ is an invalid keyword argument for this function
- TypeError(‘Keyword argument not understood:‘, ‘***‘) in keras.models load_model
- TypeError: descriptor ‘__init__‘ of ‘super‘ object needs an argument
- [!] Invalid `Podfile` file: syntax error, unexpected end-of-input, expecting keyword_end.
- AngularJS–[ng:areq] Argument ‘xxCtrl’ is not a function, got undefined! Error (Fixed)
- Module build failed: TypeError [ERR_INVALID_ARG_TYPE]: The “path“ argument must be of type string.
- TypeError: Required argument ‘mat‘ (pos 2) not found
- TypeError: __array__() takes 1 positional argument but 2 were given
- RuntimeError: ‘lengths’ argument should be a 1D CPU int64 tensor, but got 1D cuda:0 Long tensor
- Methods of modifying index and columns names by dataframe in pandas
- TypeError: translate() takes exactly one argument (2 given)
- [Solved] RuntimeError: Expected object of scalar type Float but got scalar type Double for argument #2 ‘mat1‘
- Python about typeerror: required argument ‘mat’ (POS 2) not found error resolution
- data argument can’t be an iterator
- Pytorch TypeError: __array__() takes 1 positional argument but 2 were given
- TypeError: putText() missing required argument ‘text‘ (pos 2)
- Typeerror: write() argument must be STR, not bytes and the method of writing binary file in Python 3
- Typeerror: write() argument must be STR, not bytes and the method of writing binary file in Python 3
- After introducing sass into Vue project, start to report error typeerror [err]_ INVALID_ ARG_ Type]: the “path” argument must be of type string