python - price py traceback (most recent call last)file "price py"line in columns[ float(columns[ ]radius valueerrorcould not convert string to float'"gold"this error is generated because the date has one commabecause of which an additional column is added to the listas shown belowcolumns ['jun ' ''"gold"'' '' '' 'noteone way to remove this problem is to redesign the code according to new date format note thatthe dates are in standard formats in both the cases therefore we should think like this"this is not new problem as everything is in standard formattherefore there must be an standard way to solve this problemand look for the standard library or third party packages to solve the problem currentlywe can solve this problem using csv moduleor we can use pandas-library which is quite powerful to solve the problems in data-processing click here to learn the pandas csv module in this sectionwe will see two functionalities of the csv module 'csv readerand 'csv dictreadercsv reader before modifying the python scriptlet us see the functionality of the csv module note thatin the below outputsthe stripping and splitting operations are performed by the csv module itself import csv open('price csv'' 'rows csv reader(fread the file using csv for row in rowsprint(row['date''metal''radius''price''quantity'['jun ''gold'' '' '' '['jul ''silver'' '' '' '['jan ''iron'' '' '' '['mar ''gold'' '' '' '['sep ''copper'' '' '' '['jan ''iron'' '' '' 'following is the python script which can perform the calculation on both the files 'price csvand 'price csvlisting price calculation using csv module price py import csv total_price for all items in the list with open('price csv'' 'as fopen file in read mode rows csv reader(fheader next(rowsskip line header (continues on next page csv module