Hi all. I’m Orkun, a Streamlit newby.
I looked on the web and some parts of the documentation but couldn’t be able to find a proper answer. So I decided to ask here, if this is irrelevant, please feel free to delete the post.
I am trying to build an A/B testing tool which creates academic tables for manuscripts as well. The tool will get a data file in .csv, .xlsx and .sav formats. However, as you all may know, the data types of the columns would not be proper for statistical analysis as they are in object type or something similar.
My first idea was to create a change_columns function, check if all the rows of the column are only numeric or strings and then change the types accordingly with pandas. However, It can be really slow and inefficient.
So I thought it would be a good idea if the users can change the data types with dropdown menus. And there comes my question here;
- I want the user to choose columns and the app will show its data type
- From a dropdown menu (or anything useful) will show desired data types - float16, object/category, int16 (16 is not a must of course)
- And depending on the choices that the user made, my function will run df[col] = df[col].astype(selection)
Thank you in advance
All the best
Orkun