df1
Domain Pattern Other Important Info
0 amazon.com kindle a
1 apple.com music b
2 amazon.com subscribe-and-save c
3 xyz.com
df2
Domain Url
0 google.com https://google.com/kindle
1 google.com https://google.com/
2 amazon.com https://amazon.com/subscribe-and-save
3 amazon.com https://amazon.com/abc
4 youtube.com https://youtube.com/music
5 amazon.com https:amazon.com/kindle
Основная цель - объединить два кадра данных на основе «домена», а также когда «шаблон» находится в « Веб-сайт».
blockquote>df = df1.merge(df2, on='Domain') df.loc[df.apply(lambda x: x.Pattern in x.Url, axis=1)]
Вывод
Domain Pattern Other Important Info \ 2 amazon.com kindle a 3 amazon.com subscribe-and-save c Url 2 https:amazon.com/kindle 3 https://amazon.com/subscribe-and-save
Как насчет ...
NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
[formatter setDateFormat:@"yyyy"];
//Optionally for time zone conversions
[formatter setTimeZone:[NSTimeZone timeZoneWithName:@"..."]];
NSString *stringFromDate = [formatter stringFromDate:myNSDateInstance];
//unless ARC is active
[formatter release];
Swift 4.2:
func stringFromDate(_ date: Date) -> String {
let formatter = DateFormatter()
formatter.dateFormat = "dd MMM yyyy HH:mm" //yyyy
return formatter.string(from: date)
}
Если у вас нет NSDate
-descriptionWithCalendarFormat: timeZone: locale:
доступно (я не думаю, что iPhone / Cocoa Touch включает это), вам может понадобиться использовать strftime и monkey с некоторыми строками в стиле C Вы можете получить метку времени UNIX из NSDate
, используя NSDate -timeIntervalSince1970
.