Browse Source

初始化

罗俊辉 1 year ago
parent
commit
2166c1a06f
2 changed files with 32 additions and 1 deletions
  1. 1 1
      applications/functions.py
  2. 31 0
      test.py

+ 1 - 1
applications/functions.py

@@ -37,7 +37,7 @@ class ParamProcess(object):
                 features['tag_1'] = None
                 features['tag_2'] = None
                 features['tag_3'] = None
-        df = pd.DataFrame(features)
+        df = pd.DataFrame([features])
         df.drop('title', axis=1)
         return df
 

+ 31 - 0
test.py

@@ -1,3 +1,34 @@
 """
 @author: luojunhui
 """
+import pandas as pd
+
+body = {
+    "version":"v2",
+    "features": {
+        "channel": "小年糕",
+        "out_user_id": "66506470",
+        "mode": "author",
+        "out_play_cnt": 698,
+        "out_like_cnt": 1,
+        "out_share_cnt": 41,
+        "title": "收藏好这九种中成药,让你少往医院跑。?",
+        "lop": 701 / 24698, # like_cnt + 700 / play_cnt + 24000
+        "duration": 180
+    }
+}
+
+features = {
+        "channel": "小年糕",
+        "out_user_id": "66506470",
+        "mode": "author",
+        "out_play_cnt": 698,
+        "out_like_cnt": 1,
+        "out_share_cnt": 41,
+        "title": "收藏好这九种中成药,让你少往医院跑。?",
+        "lop": 701 / 24698, # like_cnt + 700 / play_cnt + 24000
+        "duration": 180
+    }
+
+df = pd.DataFrame([features])
+print(df.columns)