Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
598faea6
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
598faea6
编写于
5月 28, 2022
作者:
D
dingbo
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
docs: change city names in docs-examples
上级
0a5742be
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
27 addition
and
28 deletion
+27
-28
docs-examples/c/async_query_example.c
docs-examples/c/async_query_example.c
+8
-8
docs-examples/python/conn_native_pandas.py
docs-examples/python/conn_native_pandas.py
+4
-4
docs-examples/python/conn_rest_pandas.py
docs-examples/python/conn_rest_pandas.py
+5
-5
docs-examples/python/connect_rest_examples.py
docs-examples/python/connect_rest_examples.py
+3
-4
docs-examples/python/json_protocol_example.py
docs-examples/python/json_protocol_example.py
+2
-2
docs-examples/python/query_example.py
docs-examples/python/query_example.py
+5
-5
未找到文件。
docs-examples/c/async_query_example.c
浏览文件 @
598faea6
...
...
@@ -182,14 +182,14 @@ int main() {
// query callback ...
// ts current voltage phase location groupid
// numOfRow = 8
// 1538548685
000 10.300000 219 0.310000 beijing.chaoyang
2
// 153854869
5000 12.600000 218 0.330000 beijing.chaoyang
2
// 15385486
96800 12.300000 221 0.310000 beijing.chaoyang 2
// 15385486
96650 10.300000 218 0.250000 beijing.chaoyang
3
// 1538548685
500 11.800000 221 0.280000 beijing.haidian
2
// 153854869
6600 13.400000 223 0.290000 beijing.haidian
2
// 15385486
85000 10.800000 223 0.290000 beijing.haidian 3
// 15385486
86500 11.500000 221 0.350000 beijing.haidian
3
// 1538548685
500 11.800000 221 0.280000 california.losangeles
2
// 153854869
6600 13.400000 223 0.290000 california.losangeles
2
// 15385486
85000 10.800000 223 0.290000 california.losangeles 3
// 15385486
86500 11.500000 221 0.350000 california.losangeles
3
// 1538548685
000 10.300000 219 0.310000 california.sanfrancisco
2
// 153854869
5000 12.600000 218 0.330000 california.sanfrancisco
2
// 15385486
96800 12.300000 221 0.310000 california.sanfrancisco 2
// 15385486
96650 10.300000 218 0.250000 california.sanfrancisco
3
// numOfRow = 0
// no more data, close the connection.
// ANCHOR_END: demo
\ No newline at end of file
docs-examples/python/conn_native_pandas.py
浏览文件 @
598faea6
...
...
@@ -13,7 +13,7 @@ print(df.head(3))
# output:
# RangeIndex(start=0, stop=8, step=1)
# <class 'pandas._libs.tslibs.timestamps.Timestamp'>
# ts current
voltage phase
location groupid
# 0 2018-10-03 14:38:05.
000 10.3 219 0.31 beijing.chaoyang
2
# 1 2018-10-03 14:38:1
5.000 12.6 218 0.33 beijing.chaoyang
2
# 2 2018-10-03 14:38:
16.800 12.3 221 0.31 beijing.chaoyang 2
# ts current
...
location groupid
# 0 2018-10-03 14:38:05.
500 11.8 ... california.losangeles
2
# 1 2018-10-03 14:38:1
6.600 13.4 ... california.losangeles
2
# 2 2018-10-03 14:38:
05.000 10.8 ... california.losangeles 3
docs-examples/python/conn_rest_pandas.py
浏览文件 @
598faea6
...
...
@@ -11,9 +11,9 @@ print(type(df.ts[0]))
print
(
df
.
head
(
3
))
# output:
# <class 'datetime.datetime'>
# RangeIndex(start=0, stop=8, step=1)
# ts current ... location groupid
# 0 2018-10-03 14:38:05+08:00 10.3 ... beijing.chaoyang 2
# 1 2018-10-03 14:38:15+08:00 12.6 ... beijing.chaoyang 2
# 2 2018-10-03 14:38:16.800000+08:00 12.3 ... beijing.chaoyang 2
# <class 'pandas._libs.tslibs.timestamps.Timestamp'>
# ts current ... location groupid
# 0 2018-10-03 06:38:05.500000+00:00 11.8 ... california.losangeles 2
# 1 2018-10-03 06:38:16.600000+00:00 13.4 ... california.losangeles 2
# 2 2018-10-03 06:38:05+00:00 10.8 ... california.losangeles 3
docs-examples/python/connect_rest_examples.py
浏览文件 @
598faea6
...
...
@@ -38,8 +38,7 @@ for row in data:
# inserted row count: 8
# queried row count: 3
# ['ts', 'current', 'voltage', 'phase', 'location', 'groupid']
# [datetime.datetime(2018, 10, 3, 14, 38, 5, tzinfo=datetime.timezone(datetime.timedelta(seconds=28800), '+08:00')), 10.3, 219, 0.31, 'beijing.chaoyang', 2]
# [datetime.datetime(2018, 10, 3, 14, 38, 15, tzinfo=datetime.timezone(datetime.timedelta(seconds=28800), '+08:00')), 12.6, 218, 0.33, 'beijing.chaoyang', 2]
# [datetime.datetime(2018, 10, 3, 14, 38, 16, 800000, tzinfo=datetime.timezone(datetime.timedelta(seconds=28800), '+08:00')), 12.3, 221, 0.31, 'beijing.chaoyang', 2]
# [datetime.datetime(2018, 10, 3, 14, 38, 5, 500000, tzinfo=datetime.timezone(datetime.timedelta(seconds=28800), '+08:00')), 11.8, 221, 0.28, 'california.losangeles', 2]
# [datetime.datetime(2018, 10, 3, 14, 38, 16, 600000, tzinfo=datetime.timezone(datetime.timedelta(seconds=28800), '+08:00')), 13.4, 223, 0.29, 'california.losangeles', 2]
# [datetime.datetime(2018, 10, 3, 14, 38, 5, tzinfo=datetime.timezone(datetime.timedelta(seconds=28800), '+08:00')), 10.8, 223, 0.29, 'california.losangeles', 3]
# ANCHOR_END: basic
docs-examples/python/json_protocol_example.py
浏览文件 @
598faea6
...
...
@@ -5,9 +5,9 @@ from taos import SmlProtocol, SmlPrecision
lines
=
[{
"metric"
:
"meters.current"
,
"timestamp"
:
1648432611249
,
"value"
:
10.3
,
"tags"
:
{
"location"
:
"California.SanFrancisco"
,
"groupid"
:
2
}},
{
"metric"
:
"meters.voltage"
,
"timestamp"
:
1648432611249
,
"value"
:
219
,
"tags"
:
{
"location"
:
"California.LosAngeles"
,
"groupid"
:
1
}},
"tags"
:
{
"location"
:
"California.LosAngeles"
,
"groupid"
:
1
}},
{
"metric"
:
"meters.current"
,
"timestamp"
:
1648432611250
,
"value"
:
12.6
,
"tags"
:
{
"location"
:
"California.SanFrancisco"
,
"groupid"
:
2
}},
"tags"
:
{
"location"
:
"California.SanFrancisco"
,
"groupid"
:
2
}},
{
"metric"
:
"meters.voltage"
,
"timestamp"
:
1648432611250
,
"value"
:
221
,
"tags"
:
{
"location"
:
"California.LosAngeles"
,
"groupid"
:
1
}}]
...
...
docs-examples/python/query_example.py
浏览文件 @
598faea6
...
...
@@ -12,10 +12,10 @@ def query_api_demo(conn: taos.TaosConnection):
# field count: 7
# meta of fi
le
s[1]: {name: ts, type: 9, bytes: 8}
# meta of fi
eld
s[1]: {name: ts, type: 9, bytes: 8}
# ======================Iterate on result=========================
# ('d100
1', datetime.datetime(2018, 10, 3, 14, 38, 5), 10.300000190734863, 219, 0.3100000023841858, 'California.SanFrancisco
', 2)
# ('d100
1', datetime.datetime(2018, 10, 3, 14, 38, 15), 12.600000381469727, 218, 0.33000001311302185, 'California.SanFrancisco
', 2)
# ('d100
3', datetime.datetime(2018, 10, 3, 14, 38, 5, 500000), 11.800000190734863, 221, 0.2800000011920929, 'california.losangeles
', 2)
# ('d100
3', datetime.datetime(2018, 10, 3, 14, 38, 16, 600000), 13.399999618530273, 223, 0.28999999165534973, 'california.losangeles
', 2)
# ANCHOR_END: iter
# ANCHOR: fetch_all
...
...
@@ -29,8 +29,8 @@ def fetch_all_demo(conn: taos.TaosConnection):
# row count: 2
# ===============all data===================
# [{'ts': datetime.datetime(2018, 10, 3, 14, 38, 5
), 'current': 10.3
00000190734863},
# {'ts': datetime.datetime(2018, 10, 3, 14, 38, 1
5), 'current': 12.600000381469727
}]
# [{'ts': datetime.datetime(2018, 10, 3, 14, 38, 5
, 500000), 'current': 11.8
00000190734863},
# {'ts': datetime.datetime(2018, 10, 3, 14, 38, 1
6, 600000), 'current': 13.399999618530273
}]
# ANCHOR_END: fetch_all
if
__name__
==
'__main__'
:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录