Category : if-statement

I have a dataset with ‘Date’ and ‘Installs’, and I want to add a new column ‘Payout’. But the ‘Payout’ differs based on the ‘Date’ and ‘Installs. eg. 2021-04-09, 2 and in the ‘Payout’ column, should be $0.25 * 2 eg. 2021-04-22, 5 and in the ‘Payout’ column, should be $0.4 * 5 I have ..

Read more

I’ve read several other questions about this subject and my identation seems correct, I really dont understand why the code below is not working! import datetime def validate(date_text): if datetime.datetime.strptime(date_text, ‘%Y-%m-%d’): print(‘format is YMD’) elif datetime.datetime.strptime(date_text, ‘%Y-%d-%m’): print(‘format is YDM’) elif datetime.datetime.strptime(date_text, ‘%d-%m-%Y’): print(‘format is DMY’) elif datetime.datetime.strptime(date_text, ‘%m-%d-%Y’): print(‘format is MDY’) else: print(‘other’) validate(‘2003-12-23’) ..

Read more

File1 1 14931 . A MQ=37;MQ0=0;DP=3;AN=4 GT:DP 0/0:. 1 14933 . G MQ=37;MQ0=0;DP=3;AN=4 GT:DP ./.:. 1 14934 . T MQ=37;MQ0=0;DP=3;AN=4 GT:DP ./.:. 1 14975 . C MQ=37;MQ0=0;DP=3;AN=4 GT:DP ./.:. 1 15021 . C AN=0 GT ./. 1 15211 . T MQ=37;MQ0=0;DP=3;AN=4 GT:DP ./.:. 1 15212 . T MQ=37;MQ0=0;DP=3;AN=4 GT:DP ./.:. File2 1 14933 rs199856693 G ..

Read more