Commit 31d84c2f authored by 张彦钊's avatar 张彦钊

add df.count

parent f665c607
......@@ -177,8 +177,10 @@ def get_data():
df["time"] = df["time"].astype("str")
df["y"] = df["stat_date"].str.cat([df["device_id"].values.tolist(),df["y"].values.tolist(),df["z"].values.tolist()], sep=",")
df = df.drop(["z","stat_date","device_id"], axis=1).fillna("na")
df = df.drop(["z","stat_date","device_id"], axis=1)
df = df.fillna("na")
print(df.head(2))
print(df.count())
features = 0
l = ["ucity_id","clevel1_id","ccity_name","device_type","manufacturer","channel","level2_ids","top","time"]
for i in l:
......@@ -248,9 +250,11 @@ def get_predict_set(model,columns):
df["y"] = df["label"].str.cat(
[df["device_id"].values.tolist(), df["ucity_id"].values.tolist(), df["cid_id"].values.tolist(),
df["y"].values.tolist(), df["z"].values.tolist()], sep=",")
df = df.drop(["z","label","device_id","cid_id"], axis=1).fillna("na")
df = df.drop(["z","label","device_id","cid_id"], axis=1)
df = df.fillna("na")
print("before transform")
print(df.shape)
print(df.count())
temp_series = model.transform(df,n=160000, processes=22)
df = pd.DataFrame(temp_series)
print("after transform")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment