發表文章

目前顯示的是 11月 28, 2018的文章

JTidy issue with numbered list item

圖片
up vote 1 down vote favorite 1 I am facing a weird problem with Numbered List Item while generating pdf using IText . The serial number of the item list is not incremented by one when a <br/> tag is appended. consider the following example: String withoutBrTag = "<html><head></head><body><p>this is order list</p>" + " <br>" + " <ol>" + " <li>lafjad</li>" + " <li>alsdfkjla </li>" + " <li>asdflkjadslfkj</li>" + " </ol>" + " <br>" + " <p>list item ended</p>&nbsp;"+ "</body></html>"; String wihBrTag = "<html><head></head><body><p>this is order list</p>" + " <br>" + " <ol>" + " <br>" + " <li>lafjad</li>" + " <br>

Creating a new column based on Calendar function

圖片
up vote 1 down vote favorite 1 I have a data frame : Year Month Week_of_month Day_of_week 0 2018 1 2 1 1 2018 1 1 2 2 2018 1 2 2 3 2018 1 1 3 4 2018 1 2 3 5 2018 1 1 4 6 2018 1 2 4 7 2018 1 1 5 8 2018 1 2 5 9 2018 1 1 6 10 2018 1 2 6 11 2018 1 1 7 Which contains: Day of week (1 to 7 -> Sunday until Saturday) Week of the month (1 until 6 - One month has a maximum of 6 weeks) I would like to get the corresponding day based on those 4 information: So, for example, to get the 30th of december of 2018 , I did this: I used this function : calendar.setfirstweekday(calendar.SUNDAY) calendar.monthcalendar(2018,12) [[0, 0, 0, 0, 0, 0, 1], [2, 3, 4, 5, 6, 7, 8], [9, 10, 11, 12, 13, 14, 15], [16, 17, 18, 19, 20, 21, 22], [23, 24, 25, 26, 27, 28, 29], [30, 31, 0, 0, 0, 0, 0]] calendar.monthcalendar(2018,12)[5][1] 31 The point is: How do I use this function to get each day in each row of my dataframe ?. I tried this: df['Day'] = calendar.monthcalendar(df.Year, df.Mo