pandas - 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?
解决方案
推荐阅读
- java - 存储 12 个国家的名称和人口的程序,两个相同大小的数组
- python - 将 pandas 数据帧转换为 xarray 数据集后的大小和顺序更改
- python - 导入多个文件并在 s3 中合并为一个大型镶木地板文件
- tableau-api - 在 tableau 中合并两个数据集,以便我可以显示未来 3 个月的预测
- visual-studio - Visual Studio 代码新更新
- java - 将两个 textArea 按特定顺序合并为一个
- java - 如何集成 Gradle、IntelliJ 和 SpotBugs?
- scala - Scala 中的偏函数
- quarkus - 我需要向 sam.jvm.yaml 添加 CORS 参数,有没有办法在 Quarkus 中做到这一点?
- react-native - 尝试使用 xcodebuild 创建的 .app 文件运行排毒测试时出错