I am a beginner in manipulating files, hence I haven't got a full grasp of it. What I want to do is, by using pandas, create a new file that has all the elements of a previews one listed based on their price in descending order. This is my code:
file = pandas.read_csv('list_of_items.csv', skiprows=1)
sorted_file = file.sort_values(by = 'price', ascending=False)
sorted_file.to_csv('items_sorted_price.csv', index=False)
However I get this error:
File "C:\Users\arcal\Anaconda3\lib\site-packages\pandas\io\parsers.py", line 1891, in __init__
self._reader = parsers.TextReader(src, **kwds)
File "pandas\_libs\parsers.pyx", line 529, in pandas._libs.parsers.TextReader.__cinit__
File "pandas\_libs\parsers.pyx", line 749, in pandas._libs.parsers.TextReader._get_header
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xef in position 0: invalid continuation byte
What can I do to solve the problem? Where would you recommend a beginner like me to start working in order to grasp better this topic? Thanks in advance for your help.