Aug-31-2023, 04:15 PM
Hi, sorry if something wrong im new its my first post.
Im learning python but english is not my native language and i dont know how to properly put sentence to search so i thought i might ask a question in this forum.
I have spreadhseet table with thousands of records and looking to edit it using python.
My column consist of " city, state,zip" i manually added column to add "city,state" and "zip" but im looking to make it easier. I would rather tell python to read specific column and separate zips and once zip separated - read the first 3 digits of it and if zip contains XXX number - should be writen "YYYY" (XXX and YYY is just generic for example purpose ) and this need to be done by creating another column after "zip" .
Is this possible ? If yes - i would be appreciated if pythonistas could guide me to the right direction to create this code or an example.
As i have strugle to undserstand - example and how to would be even more appretiated.
P.s. ill be using streamlit, pandas as well and i think few more extras so if things are combined together - im more than hhappy to use them.
Also im using Python version 3.11
Thank You and have a Great Day !
Im learning python but english is not my native language and i dont know how to properly put sentence to search so i thought i might ask a question in this forum.
I have spreadhseet table with thousands of records and looking to edit it using python.
My column consist of " city, state,zip" i manually added column to add "city,state" and "zip" but im looking to make it easier. I would rather tell python to read specific column and separate zips and once zip separated - read the first 3 digits of it and if zip contains XXX number - should be writen "YYYY" (XXX and YYY is just generic for example purpose ) and this need to be done by creating another column after "zip" .
Is this possible ? If yes - i would be appreciated if pythonistas could guide me to the right direction to create this code or an example.
As i have strugle to undserstand - example and how to would be even more appretiated.
P.s. ill be using streamlit, pandas as well and i think few more extras so if things are combined together - im more than hhappy to use them.
Also im using Python version 3.11
Thank You and have a Great Day !