Ok, now I see what I did. Legacy from when the get_rain_data function
returned precipitation and error. I forgot to remove the brackets from
the 'return [precip]' statement.
It works perfectly now. Thanks for all the help.
2010/10/14, Evert Rol :
>> Thanks for the reply. I've tried your suggestio
> Thanks for the reply. I've tried your suggestion and am still getting
> an error (posted below code). Since my posting, I've also added the
> code to convert the numpy array to a list. My complete script is:
>
> -
> # -*- coding: utf-8 -*-
>
> import pupynere
> import os
> import csv
> impo
Hi Evert,
Thanks for the reply. I've tried your suggestion and am still getting
an error (posted below code). Since my posting, I've also added the
code to convert the numpy array to a list. My complete script is:
-
# -*- coding: utf-8 -*-
import pupynere
import os
import csv
import glob
de
"Hanlie Pretorius" wrote
# file_details[0] is the date and file_details[1] is the time
writer.writerow(('%s' % (file_details[0]),'%s' %
(file_details[1]),'%f' % (data[0])))
Instead, I get an error
TypeError: float argument required, not numpy.ndarray
Try using %s instead of %f just to see w
> I have a numpy array ('data') that is the result of reading a netCDF
> file, and it typically looks like this:
>
> array([ 0., 0., 0., 0.], dtype=float32)
>
>
> I want to write this, after a date and time, to a CSV file, so the CSV
> file would have the entry:
>
>2000-02-01,09:00,0.0,0
Hi,
I have a numpy array ('data') that is the result of reading a netCDF
file, and it typically looks like this:
array([ 0., 0., 0., 0.], dtype=float32)
I want to write this, after a date and time, to a CSV file, so the CSV
file would have the entry:
2000-02-01,09:00,0.0,0.0,0.0,0.0
T