Skip to content

Getting error in renaming the columns #1933

@Aditya222002

Description

@Aditya222002

I am getting error in renaming the columns

CODE:
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
url="C:/Users/Lenovo/Desktop/Edited_car1.csv"
car=pd.read_csv(url)
drive_wheels_count=car["drive-wheels"].value_counts()
drive_wheels_count.rename(columns={'drive-wheels':'value_count'},inplace=True)

ERROR:

runfile('C:/Users/Lenovo/.spyder-py3/untitled0.py', wdir='C:/Users/Lenovo/.spyder-py3')
Traceback (most recent call last):

File "C:\Users\Lenovo.spyder-py3\untitled0.py", line 7, in
drive_wheels_count.rename(columns={'drive-wheels':'value_count'},inplace=True)

TypeError: rename() got an unexpected keyword argument 'columns'

SCREENSHOTS:


image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions