首页 > 解决方案 > Pandas read_hdf5 partial matching of a string

问题描述

I have a database with about 20K records and I want to use hdf5 instead of sql to query it as it seems quicker. However, I want to use a LIKE-like syntax to do it, but it seems that pandas.read_hfd5 can just find exact matches.My code snippet is as follow.

import pandas as pd
pd.read_hdf("test.hdf5",'myTable', where="name = %r" % query)

For example if the user enter user1 or User1 or USER1 it should return the same result.

Any suggestions?

标签: pandashdf5

解决方案


推荐阅读