OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

How can I convert a feather file to CSV using Python?

  • Thread starter Thread starter Zeina Yousri
  • Start date Start date
Z

Zeina Yousri

Guest
How to convert feather file into csv file using python?

I tried using feather module, pyarrow.feather I could only read it but I couldn't convert it to csv format.

Code:
# when using pandas
import pandas as pd
df = pd.read_feather('coffee_ratings_full.feather')

I got this error=>

Code:
ArrowInvalid                              Traceback (most recent call last)
~\AppData\Local\Temp/ipykernel_26876/2731998856.py in <module>
----> 1 df = pd.read_feather('coffee_ratings_full.feather')

~\Anaconda3\lib\site-packages\pandas\io\feather_format.py in read_feather(path, columns, use_threads, storage_options)
    128     ) as handles:
    129 
--> 130         return feather.read_feather(
    131             handles.handle, columns=columns, use_threads=bool(use_threads)
    132         )

~\Anaconda3\lib\site-packages\pyarrow\feather.py in read_feather(source, columns, use_threads, memory_map, **kwargs)
    224         The contents of the Feather file as a pandas.DataFrame
    225     """
--> 226     return (read_table(
    227         source, columns=columns, memory_map=memory_map,
    228         use_threads=use_threads).to_pandas(use_threads=use_threads, **kwargs))

~\Anaconda3\lib\site-packages\pyarrow\feather.py in read_table(source, columns, memory_map, use_threads)
    250         The contents of the Feather file as a pyarrow.Table
    251     """
--> 252     reader = _feather.FeatherReader(
    253         source, use_memory_map=memory_map, use_threads=use_threads)
    254 

~\Anaconda3\lib\site-packages\pyarrow\_feather.pyx in pyarrow._feather.FeatherReader.__cinit__()

~\Anaconda3\lib\site-packages\pyarrow\error.pxi in pyarrow.lib.pyarrow_internal_check_status()

~\Anaconda3\lib\site-packages\pyarrow\error.pxi in pyarrow.lib.check_status()

ArrowInvalid: File is too small to be a well-formed file
<p>How to convert feather file into csv file using python?</p>
<p>I tried using feather module, pyarrow.feather I could only read it but I couldn't convert it to csv format.</p>
<pre><code># when using pandas
import pandas as pd
df = pd.read_feather('coffee_ratings_full.feather')
</code></pre>
<p>I got this error=></p>
<pre><code>ArrowInvalid Traceback (most recent call last)
~\AppData\Local\Temp/ipykernel_26876/2731998856.py in <module>
----> 1 df = pd.read_feather('coffee_ratings_full.feather')

~\Anaconda3\lib\site-packages\pandas\io\feather_format.py in read_feather(path, columns, use_threads, storage_options)
128 ) as handles:
129
--> 130 return feather.read_feather(
131 handles.handle, columns=columns, use_threads=bool(use_threads)
132 )

~\Anaconda3\lib\site-packages\pyarrow\feather.py in read_feather(source, columns, use_threads, memory_map, **kwargs)
224 The contents of the Feather file as a pandas.DataFrame
225 """
--> 226 return (read_table(
227 source, columns=columns, memory_map=memory_map,
228 use_threads=use_threads).to_pandas(use_threads=use_threads, **kwargs))

~\Anaconda3\lib\site-packages\pyarrow\feather.py in read_table(source, columns, memory_map, use_threads)
250 The contents of the Feather file as a pyarrow.Table
251 """
--> 252 reader = _feather.FeatherReader(
253 source, use_memory_map=memory_map, use_threads=use_threads)
254

~\Anaconda3\lib\site-packages\pyarrow\_feather.pyx in pyarrow._feather.FeatherReader.__cinit__()

~\Anaconda3\lib\site-packages\pyarrow\error.pxi in pyarrow.lib.pyarrow_internal_check_status()

~\Anaconda3\lib\site-packages\pyarrow\error.pxi in pyarrow.lib.check_status()

ArrowInvalid: File is too small to be a well-formed file
</code></pre>
 

Latest posts

Top