#python #error-handling
Вопрос:
Я получаю эту ошибку при запуске своего кода:
Ошибка UFuncTypeError: ufunc «умножение» не содержал цикла с типами соответствия сигнатур (dtype (‘<U32’), dtype (‘<U32’)) — > dtype (‘<U32’)) — >
Я новичок в python и кодировании, поэтому надеюсь, что здесь я предоставляю соответствующую информацию для решения проблемы.
Я могу печатать все остальные переменные, но когда я пытаюсь напечатать WindPower_capacity_factor_месячно, я получаю ошибку. Не уверен, как работать с моими данными отсюда.
Это мой код:
#import matplotlib.pyplot as plt
import numpy as np
#from mpl_toolkits.basemap import Basemap
nc = Dataset('/Users/fredrikvonschlanbusch/Documents/Skole/Master/WindPower_capacity_factor_monthly.nc')
cf = nc['WindPower_capacity_factor_monthly'][:]
print(cf)
nc выглядит так:
root group (NETCDF4 data model, file format HDF5):
description: NORwegian hindcast Archive Wind Power data set (NORA3-WP)
institution: Geophysical Institute, Bergen offshore wind centre, University of Bergen, Norway
production: Created using MatLab (version 2018b)
author: Ida M. Solbrekke (email: ida.solbrekke@gfi.uib.no) and Asgeir Sorteberg (email: Asgeir.Sorteberg@uib.no)
date: 15-Aug-2021
dimensions(sizes): X(652), Y(1149), T(288), Z(3), stringlength(15), M(1), methodlength(1000), turbine(3)
variables(dimensions): float64 lon(Y, X), float64 lat(Y, X), float64 projection_lambert(), float64 time(T), float32 hub_heights(Z), |S1 turbine_name(stringlength, Z), float32 turbine_rated_power(Z), float32 turbine_cut_in_wind_speed(Z), float32 turbine_rated_wind_speed(Z), float32 turbine_cut_out_wind_speed(Z), |S1 method(methodlength, M), float32 WindPower_capacity_factor_monthly(T, M, turbine, Y, X)
cf выглядит так:
float32 WindPower_capacity_factor_monthly(T, M, turbine, Y, X)
long_name: WindPower_capacity_factor_monthly
standard_name: WindPower_capacity_factor_monthly
units: Percentage (%)
scale_factor: 1
coordinates: lat lon
variable_description: Capacity factor is here the ratio between the monthly generated wind power and the monthly maximum possible wind power output
unlimited dimensions: T
current shape = (288, 1, 3, 1149, 652)
filling on, default _FillValue of 9.969209968386869e 36 used