Showing results for 
Search instead for 
Did you mean: 
Copilot Lvl 2
Message 1 of 2

Sas to pandas

How do I write below sas code to python
If type in (1,4,5,6) then flag=1;
Else if substr(source,1,1)=A or substr(source,1,2)=CA then flag=1;
Else flag=0;

You can see some syntax in sas..can u tell me the best way to write in pandas
1 Reply
Community Manager
Message 2 of 2

Re: Sas to pandas

Hi @elan98765,


This post was moved to a different board that fits your topic of discussion a bit better. This means you’ll get better engagement on your post, and it keeps our community organized so users can more easily find information.

As you’ll notice, your topic is now here in the Programming Help and Discussion board. No action is needed on your part; you can continue the conversation as normal here.


Thanks for being here, sharing, and keeping our community awesome!

Mark helpful posts with Accept as Solution to help other users locate important info. Don't forget to give Kudos for great content!