Open fumitoh opened 4 months ago
Hi, I am really excited to test various modelx features nowadays.
I want to ask some tips about preserving the data type of ref data ( which I get via new_pandas function) after saving the model.
Below is an example which I faced some trouble.
1) I make ref variable in my model by using the code below
df = pd.read_csv('test.csv', dtype = {'PROD_CODE' : 'string', 'PLAN_CODE' : 'string'}, index_col=['PROD_CODE', 'PLAN_CODE']) P.new_pandas("test","test.csv",data=df,file_type ="csv",sheet = "sheet1")
sample data
PROD_CODE PLAN_CODE RATE "1111","0055",0.04 "1112","0001",0.03
2) I can get exact same data when I make the ref varable "test"
3) However, after I saved the model, it seems the data type I assigned to each column ( STRING to "PROD_CODE" and "PLAN_CODE" disappear)
--> When I reload the model, the data changed as below
after reloading the model
PROD_CODE PLAN_CODE RATE 1111,55,0.04 1112,1,0.03
If there is any way to preserve the data type of each column I first assigned, pleas let me know.
Thank you for reading my question!
Originally posted by @LimYoonhwan in https://github.com/fumitoh/modelx/discussions/107
Hi, I am really excited to test various modelx features nowadays.
I want to ask some tips about preserving the data type of ref data ( which I get via new_pandas function) after saving the model.
Below is an example which I faced some trouble.
1) I make ref variable in my model by using the code below
sample data
2) I can get exact same data when I make the ref varable "test"
3) However, after I saved the model, it seems the data type I assigned to each column ( STRING to "PROD_CODE" and "PLAN_CODE" disappear)
--> When I reload the model, the data changed as below
after reloading the model
If there is any way to preserve the data type of each column I first assigned, pleas let me know.
Thank you for reading my question!
Originally posted by @LimYoonhwan in https://github.com/fumitoh/modelx/discussions/107