Is it possible to cache column splits and mapping? [Solved]

Hi ST community !
Im trying to understand st.cache_data.
I have CSV data file with 200k rows and 22 columns but 2 columns are split into multiple columns.
Location : splits to zip, state and city
Date column: splits into year, day of week, month.
Once Location column split into 3 columns ( two step split ), i map Zip column to another column and State column i map to another column and from one column i get 5 columns but problem is - 200k csv crashes most of the time and 25 and 50k columns takes a while to load and if i filter them it takes time again.
How can i speed up ?
i have @st.cache_data on my zip and area codes:

def area_zip(zipcode):
    zips = { "010": "XXX"} 
    return zips[zipcode[:3]]

Same with state column.
Then i have df['column] = df['column'].map(area_zips) and another with state column.
Date columns i split are used for filtering but actual date column(original) is displayed in data frame.
Location column is show in in data frame together with 2 mapped columns but in filtering ( also map ) i use state and mapped columns. Also i do have some calculations and graphs but i know i can use state session and callbacks with graphs so should be easier with it.
How can i speed up or not to crash my app or im wrong with st.cache_data and its not going to help me ?
Thank You.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.