I'm trying to extract attribute data from a layer in QGIS (version 2.18.2 for mac) to use it internally on my plugin (I need that due to complex matrix operations with numpy and scipy), but QGIS is always returning rounded values with different methods, e.g.:
Original data when viewing it from open attribute table option:
[3.46000000, 0.48000000, 12.86999999, 13.30000000, ...]
layer = iface.activeLayer() print layer.getValues('G2') #G2 is the field name >>> [3.46, 0.48, 12.87, 13.3, ...]
field = [f['G2'] for f in layer.getFeatures()] print field >>> [3.46, 0.48, 12.87, 13.3, ...]
dpro = layer.dataProvider() feat = [f['G2'] for f in dpro.getFeatures()] print feat >>> [3.46, 0.48, 12.87, 13.3, ...]
At the first moment I thought it could be a display limitation from console's output (I was testing there before implementing on the plugin), but running from the plugin I had the same result.
Is there a method where I can extract the data with all the decimals?