Skip to content

Tag: pandas

Pandas read_json ValueError: Protocol not known

I ran the following code a while ago and it worked but now there is the following error. How to solve it? ValueError: protocol not known. Answer As far as I could debug this issue is caused by an update of pandas. The 1.1.0 update had changed few things on the read_json function. I could make my code work whe…

Empty dataframe when filtering

I have a dataframe that looks like this: Now I’d like to filter like this: However, I am getting an empty dataframe. What am I doing wrong here? Answer Try df1.loc[df1[‘PZAE’]==”‘HAE’”] Details : the column ‘PZAE’ contains str starting and finishing by ‘ t…