我正在尝试对简单数据集执行最小-最大缩放
data2 = [10, 20, 35, 70, 100]
Run Code Online (Sandbox Code Playgroud)
以下代码给我一个错误
AttributeError:“列表”对象没有属性“列”
def min_max_scaling(df):
df_norm = df.copy()
for col in df_norm.columns:
df_norm[col] = (df_norm[col] - df_norm[col].min()) / (df_norm[col].max() - df_norm[col].min())
return df_norm
df_normalized = min_max_scaling(data3)
df_normalized
Run Code Online (Sandbox Code Playgroud) 我正在编写一个使用地理定位的应用程序。一切都在网络和 Android 上完美运行。但是,在 ios 上,我无法获取位置(我实现的第二种方法 - 从地图中选择一个位置虽然有效)
我在 Xcode 控制台中收到此错误:
?? To Native -> Geolocation getCurrentPosition 7620184
ERROR MESSAGE: {"errorMessage":"The operation couldn’t be completed.
(kCLErrorDomain error 0.)","message":"The operation couldn’t be completed.
(kCLErrorDomain error 0.)"}Run Code Online (Sandbox Code Playgroud)
这是我获取位置的方法:
private locateUser() {
if (!Capacitor.isPluginAvailable('Geolocation')) {
this.showErrorAlert();
return;
}
this.isLoading = true;
Plugins.Geolocation.getCurrentPosition()
.then(geoPosition => {
const coordinates: Coordinates = {
lat: geoPosition.coords.latitude,
lng: geoPosition.coords.longitude
};
this.createPlace(coordinates.lat, coordinates.lng);
this.isLoading = false;
})
.catch(err => {
this.isLoading = false;
this.showErrorAlert();
});
}Run Code Online (Sandbox Code Playgroud)
你知道什么可能导致这种情况吗?