-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcheck_read_write.py
More file actions
44 lines (35 loc) · 1.17 KB
/
check_read_write.py
File metadata and controls
44 lines (35 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import pandasx as pdx
import stdlib.logging as logging
# vw_food_import_kg_train_test_area_skill.csv
def main():
df = pdx.read_data(
"./vw_food_import_kg_train_test_area_skill_mini.csv",
datetime=('date', '%Y/%m/%d %H:%M:%S', 'M'),
# categorical=['imp_month'],
na_values=["(null)"]
)
# dff = pdx.read_data(
# "postgresql://localhost:5432/python",
# user="postgres",
# password="p0stgres",
# # table="food_import_kg_train_test"
# sql="select * from food_import_kg_train_test where item in :items and country in :countries",
# params=dict(
# items=["ANIMAL FEED"],
# countries=["ARGENTINA", "AUSTRALIA"]
# )
# )
# pdx.write_data(
# df,
# "postgresql://localhost:5432/python",
# user="postgres",
# password="p0stgres",
# table="food_import_kg_train_test_mini",
# groups=["item","country"]
# )
data = pdx.write_data(df, "memory:", orient="list")
pass
if __name__ == '__main__':
logging.config.fileConfig('logging_config.ini')
logging.getLogger('root').info('Logging initialized')
main()