Skip to content
Advertisement

How to fix Value error “Length of Values (1) doesn match length of index (15)”

Workflow =>

  • Read CSV file and get Unit Price column data
  • Convert column data price and create a new column as name ‘Fabric’
  • save the output as xlsx

Sample:

JavaScript

My code:

JavaScript

Error :

Advertisement

Answer

Insted of iterating column value. Try this,

pandas built-in function called .replace() is useful for replacing the value in the column without iteration throung it

JavaScript

Above code will successfully relace the dataframe column values inplace.

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement