Issue
I am trying to read a file in hdf format. It was working correctly before but now all of a sudden I am getting the error below:
pandas\_libs\writers.pyx in pandas._libs.writers.string_array_replace_from_nan_rep()
ValueError: Buffer dtype mismatch, expected 'Python object' but got 'double'
My code is just as below:
import pandas as pd
data = pd.read_hdf('p1.hdf')
data
I am using Jupyter notebook and on python 3.6. I just cannot understand why I was able to read the file before without any issues and now this error pops up. The different things that I did since the last run was to create a virtual env to run another code and as I experienced this error now, I reinstalled anaconda but I am still getting this error when reading this file :(
Solution
You might have installed the newest pandas version. I had the same issue with the pandas-0.23.4, downgrading it to 0.22.0 fixed it for me.
Answered By - Artur Kucia
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.