本文整理汇总了Python中pyvttbl.DataFrame._execute方法的典型用法代码示例。如果您正苦于以下问题:Python DataFrame._execute方法的具体用法?Python DataFrame._execute怎么用?Python DataFrame._execute使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyvttbl.DataFrame
的用法示例。
在下文中一共展示了DataFrame._execute方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test3
# 需要导入模块: from pyvttbl import DataFrame [as 别名]
# 或者: from pyvttbl.DataFrame import _execute [as 别名]
def test3(self):
"""test with string keys and tuple where condition"""
df = DataFrame()
df[1] = range(100)
df[2] = ["bob" for i in range(100)]
df[3] = [i * 1.234232 for i in range(100)]
df[4] = ["bob" for i in range(50)] + range(50)
shuffle(df[1])
shuffle(df[2])
shuffle(df[3])
df._build_sqlite3_tbl(df.keys()[:2], [(4, "!=", "bob")])
df._execute("select * from TBL")
for i, (a, b) in enumerate(df.cur):
self.assertEqual(a, df[1][i + 50])
self.assertEqual(b, df[2][i + 50])
示例2: test22
# 需要导入模块: from pyvttbl import DataFrame [as 别名]
# 或者: from pyvttbl.DataFrame import _execute [as 别名]
def test22(self):
"""test with string keys and where condition"""
df = DataFrame()
df["1"] = range(100)
df["2"] = ["bob" for i in range(100)]
df["3"] = [i * 1.234232 for i in range(100)]
df["4"] = ["bob" for i in range(50)] + range(50)
shuffle(df["1"])
shuffle(df["2"])
shuffle(df["3"])
df._build_sqlite3_tbl(df.keys()[:2], ['4 not in ("bob")'])
df._execute("select * from TBL")
for i, (a, b) in enumerate(df.cur):
self.assertEqual(a, df["1"][i + 50])
self.assertEqual(b, df["2"][i + 50])
示例3: test1
# 需要导入模块: from pyvttbl import DataFrame [as 别名]
# 或者: from pyvttbl.DataFrame import _execute [as 别名]
def test1(self):
"""test with integer keys subset of table"""
df = DataFrame()
df[1] = range(100)
df[2] = ["bob" for i in range(100)]
df[3] = [i * 1.234232 for i in range(100)]
df[4] = ["bob" for i in range(50)] + range(50)
shuffle(df[1])
shuffle(df[2])
shuffle(df[3])
shuffle(df[4])
df._build_sqlite3_tbl(df.keys()[:2])
df._execute("select * from TBL")
for i, (a, b) in enumerate(df.cur):
self.assertEqual(a, df[1][i])
self.assertEqual(b, df[2][i])
示例4: test02
# 需要导入模块: from pyvttbl import DataFrame [as 别名]
# 或者: from pyvttbl.DataFrame import _execute [as 别名]
def test02(self):
"""test with tuple keys"""
df = DataFrame()
## df.PRINTQUERIES = True
df[(1,)] = range(100)
df[(2,)] = ["bob" for i in range(100)]
df[(3,)] = [i * 1.234232 for i in range(100)]
df[(4,)] = ["bob" for i in range(50)] + range(50)
shuffle(df[(1,)])
shuffle(df[(2,)])
shuffle(df[(3,)])
shuffle(df[(4,)])
df._build_sqlite3_tbl(df.keys())
df._execute("select * from TBL")
for i, (a, b, c, d) in enumerate(df.cur):
self.assertEqual(a, df[(1,)][i])
self.assertEqual(b, df[(2,)][i])
self.assertEqual(c, df[(3,)][i])
self.assertEqual(d, str(df[(4,)][i]))
示例5: test00
# 需要导入模块: from pyvttbl import DataFrame [as 别名]
# 或者: from pyvttbl.DataFrame import _execute [as 别名]
def test00(self):
"""test with string keys"""
df = DataFrame()
## df.PRINTQUERIES=True
df["1"] = range(100)
df["2"] = ["bob" for i in range(100)]
df["3"] = [i * 1.234232 for i in range(100)]
df["4"] = ["bob" for i in range(50)] + range(50)
df["5"] = np.sqrt(df["3"] * 100.0)
## print(df)
shuffle(df["1"])
shuffle(df["2"])
shuffle(df["3"])
df._build_sqlite3_tbl(df.keys())
df._execute("select * from TBL")
for i, (a, b, c, d, e) in enumerate(df.cur):
self.assertEqual(a, df["1"][i])
self.assertEqual(b, df["2"][i])
self.assertEqual(c, df["3"][i])
self.assertEqual(d, str(df["4"][i]))