-1

Using python 3.5

In yahoo finance I downloaded banknifty .csv

enter image description here

the sheet needs to depict three coin toss per day. At random time . However i couldnt automate the date to repeat three times before next date kicks in.help please

sujith
  • 1
  • 2
  • If you don't understand python well enough to do this, you could easily do it with excel. – John Oct 24 '16 at 19:37
  • please post the code you're using. you're telling that you have the numbers and want to create a column with the days of the week? Ex.: '24/oct/2016' = 'monday' ? – dot.Py Oct 24 '16 at 23:27
  • The, exactly like what you have mentioned. 24 Oct 2016= Monday. Then I could just choose Thursday's data. And analyse it. I have been coding since a month in python. – sujith Oct 25 '16 at 03:34
  • This is more suitable for StackOverflow but needs too much editing for me to migrate. – Bob Jansen Oct 25 '16 at 09:17
  • I'm voting to close this question as off-topic because not a fit here, not fit for migration. – Bob Jansen Oct 25 '16 at 09:17

1 Answers1

1

Without your code it isn't clear, however here are 3 options for grabbing the day from a date in a string:

from datetime import datetime
import calendar
d='10/24/2016' #Oct 24th, 2016
m_date=datetime.strptime(d,"%m/%d/%Y")
print "Your date:",m_date
print "Option 1: ",calendar.day_name[m_date.weekday()]
print "Option 2: ",datetime.today().weekday()
print "Option 3: ",datetime.today().strftime("%A")
OTP
  • 36
  • 3