我有一些lon-lat点是字符串格式的。下面是示例数据
现在,我想使用它们并将它们放入两个不同的列表中,分别用于lon和lat
但是,这些数据都是字符串格式,在单个列表结构中。我想这意味着我需要使用正则表达式
我试着使用下面的代码
re.sub("^(\+|-)?(?:90(?:(?:\.0{1,6})?)|(?:[0-9]|[1-8][0-9])(?:(?:\.[0-9]{1,6})?))$"
,"",exampledatalatlon[1])
但我不能让它工作。如果我已经尝试过这些方法,有没有人知道一种快速简单的方法可以将其重新格式化为整数格式(int()不起作用)
干杯
怎么了,迈克尔。让我知道这是否是你要找的。该脚本获取您的输入字符串,将假定的数据点分离到单独的列表中,并将其转换为浮点
相关问题 更多 >
编程相关推荐