Вы уверены, что все строки имеют не менее 2 столбцов? Вы можете попробовать что-то вроде, просто чтобы проверить?:
sc.textFile("file.csv") \
.map(lambda line: line.split(",")) \
.filter(lambda line: len(line)>1) \
.map(lambda line: (line[0],line[1])) \
.collect()
В качестве альтернативы вы можете распечатать виновника (если есть):
sc.textFile("file.csv") \
.map(lambda line: line.split(",")) \
.filter(lambda line: len(line)<=1) \
.collect()
import UIKit
import CoreLocation
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
var currentLocation = CLLocation(latitude: 23.1929, longitude: 72.6156)
var DestinationLocation = CLLocation(latitude: 23.0504, longitude: 72.4991)
var distance = currentLocation.distance(from: DestinationLocation) / 1000
print(String(format: "The distance to my buddy is %.01fkm", distance))
}
}