Commit a6cba4eb authored by 赵威's avatar 赵威

get data from file

parent c7d5572c
import pandas as pd
from utils.defs import nth_element
from utils.files import get_df
from utils.utils import nth_element
DEVICE_COLUMNS = [
"device_id",
......
import pandas as pd
from utils.defs import nth_element
from utils.files import get_df
DEVICE_COLUMNS = [
"device_id",
]
TRACTATE_COLUMNS = [
"card_id",
]
def device_tractae_fe():
click_df = get_df("personas_tractate_click.csv")
exposure_df = get_df("personas_tractate_exposure.csv")
device_fe_df = get_df("personas_device_feature.csv")
tractate_tags_df = get_df("personas_tractate_tags.csv")
print(click_df.shape)
print(exposure_df.shape)
print(device_fe_df.shape)
print(tractate_tags_df.shape)
if __name__ == "__main__":
click_df = get_df("personas_tractate_click.csv")
exposure_df = get_df("personas_tractate_exposure.csv")
device_fe_df = get_df("personas_device_feature.csv")
tractate_tags_df = get_df("personas_tractate_tags.csv")
print(click_df.shape)
print(exposure_df.shape)
print(device_fe_df.shape)
print(tractate_tags_df.shape)
print(tractate_tags_df.head(3))
......@@ -34,5 +34,6 @@ def save_dict_to_csv(d, file):
def get_df(file):
full_path = os.path.join(DATA_PATH, file)
print(full_path)
df = pd.read_csv(full_path, sep="|")
return df
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