You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by qi...@apache.org on 2022/08/11 07:04:41 UTC

[iotdb] branch master updated: [IOTDB-3801] Update doc about python numpy tablet (#6863)

This is an automated email from the ASF dual-hosted git repository.

qiaojialin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/iotdb.git


The following commit(s) were added to refs/heads/master by this push:
     new 61a8ff2238 [IOTDB-3801] Update doc about python numpy tablet (#6863)
61a8ff2238 is described below

commit 61a8ff2238d51d505157072cd924e46141fd80bc
Author: Haonan <hh...@outlook.com>
AuthorDate: Thu Aug 11 15:04:37 2022 +0800

    [IOTDB-3801] Update doc about python numpy tablet (#6863)
---
 client-py/README.md                                    | 1 +
 docs/UserGuide/API/Programming-Python-Native-API.md    | 3 ++-
 docs/zh/UserGuide/API/Programming-Python-Native-API.md | 5 +++--
 3 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/client-py/README.md b/client-py/README.md
index beef55e351..3197cc7186 100644
--- a/client-py/README.md
+++ b/client-py/README.md
@@ -187,6 +187,7 @@ With less memory footprint and time cost of serialization, the insert performanc
 (if not, the default dtypes are also ok).
 
 ```python
+import numpy as np
 data_types_ = [
     TSDataType.BOOLEAN,
     TSDataType.INT32,
diff --git a/docs/UserGuide/API/Programming-Python-Native-API.md b/docs/UserGuide/API/Programming-Python-Native-API.md
index 0f962ebb44..971c3ba9c4 100644
--- a/docs/UserGuide/API/Programming-Python-Native-API.md
+++ b/docs/UserGuide/API/Programming-Python-Native-API.md
@@ -165,6 +165,7 @@ With less memory footprint and time cost of serialization, the insert performanc
    (if not, the default dtypes are also ok).
 
 ```python
+import numpy as np
 data_types_ = [
     TSDataType.BOOLEAN,
     TSDataType.INT32,
@@ -179,7 +180,7 @@ np_values_ = [
     np.array([11, 11111, 1, 0], TSDataType.INT64.np_dtype()),
     np.array([1.1, 1.25, 188.1, 0], TSDataType.FLOAT.np_dtype()),
     np.array([10011.1, 101.0, 688.25, 6.25], TSDataType.DOUBLE.np_dtype()),
-    np.array(["test01", "test02", "test03", "test04"], TSDataType.TEXT.np_dtype()),
+    np.array(["test01", "test02", "test03", "test04"]),
 ]
 np_timestamps_ = np.array([1, 2, 3, 4], TSDataType.INT64.np_dtype())
 np_tablet_ = NumpyTablet(
diff --git a/docs/zh/UserGuide/API/Programming-Python-Native-API.md b/docs/zh/UserGuide/API/Programming-Python-Native-API.md
index 9f385081bd..dbda869b5f 100644
--- a/docs/zh/UserGuide/API/Programming-Python-Native-API.md
+++ b/docs/zh/UserGuide/API/Programming-Python-Native-API.md
@@ -161,9 +161,10 @@ session.insert_tablet(tablet_)
 
 **注意**
 1. Tablet 中的每一列时间戳和值记录为一个 ndarray
-2. ndarray 推荐使用如下面例子中的特定的 dtype,如果不使用,不会影响正确性。
+2. Numpy Tablet 只支持大端类型数据,ndarray 构建时如果不指定数据类型会使用小端,因此推荐在构建 ndarray 时指定下面例子中类型使用大端。如果不指定,IoTDB Python客户端也会进行大小端转换,不影响使用正确性。
 
 ```python
+import numpy as np
 data_types_ = [
     TSDataType.BOOLEAN,
     TSDataType.INT32,
@@ -178,7 +179,7 @@ np_values_ = [
     np.array([11, 11111, 1, 0], TSDataType.INT64.np_dtype()),
     np.array([1.1, 1.25, 188.1, 0], TSDataType.FLOAT.np_dtype()),
     np.array([10011.1, 101.0, 688.25, 6.25], TSDataType.DOUBLE.np_dtype()),
-    np.array(["test01", "test02", "test03", "test04"], TSDataType.TEXT.np_dtype()),
+    np.array(["test01", "test02", "test03", "test04"]),
 ]
 np_timestamps_ = np.array([1, 2, 3, 4], TSDataType.INT64.np_dtype())
 np_tablet_ = NumpyTablet(