Errors in installation of matplotlib and pandas on Macbook

2016-06-29 Thread Madhavan Bomidi
Hello everyone, I am very new to Macbook and python. I have installed python through MacPorts and when I check if all the packages I required are installed properly, I get the following traceback errors for matplotlib and pandas packages. Can anyone suggest me how I can rectify the same? I

Re: Errors in installation of matplotlib and pandas on Macbook

2016-06-29 Thread Madhavan Bomidi
Can you please suggest me what I shall do to make sure all the libraries that I have indicated above work in python? I don't know how I can get back to obsolete version of Python. Please suggest me the commands or references of previous posts, if any. Thanks and regards, Madhavan --

Re: Errors in installation of matplotlib and pandas on Macbook

2016-06-29 Thread Madhavan Bomidi
Hello ChrisA, Thanks for your suggestion. My script works fine when I run the command 'export LC_ALL=en_AU.utf8' before starting python. I am from India and using US English and international keyboard. I also tried using the command 'export LC_ALL=en_USA.utf8' and the python script works fine.

Re: Errors in installation of matplotlib and pandas on Macbook

2016-06-30 Thread Madhavan Bomidi
Hello ChrisA, Thanks for your suggestion. I have typed the following on Terminal: $ locale LANG= LC_COLLATE="C" LC_CTYPE="C" LC_MESSAGES="C" LC_MONETARY="C" LC_NUMERIC="C" LC_TIME="C" LC_ALL="C" How should I modify the profile/configuration of locale permanently? Is it possible to do this on

How to overlay data points on a static google image?

2016-10-18 Thread Madhavan Bomidi
Hello everyone, I have been using IDL for making plots until recently and currently transitioning to Python programming. I have a task to obtain a static google image for my region of interest and then overlay the variable frequency counts at different lat-long coordinates. While I have

How can I find the indices of an array with float values in python?

2019-01-10 Thread Madhavan Bomidi
I have an array (numpy.ndarray) with shape (1500L,) as below: x = array([ 3.e+01, 6.e+01, 9.e+01, ..., 4.4940e+04, 4.4970e+04, 4.5000e+04]) Now, I wanted to determine the indices of the x values between 0.0 and 15.0. While this is simple in

Re: How can I find the indices of an array with float values in python?

2019-01-10 Thread Madhavan Bomidi
Sorry for re-posting with a correction. I have an array (numpy.ndarray) with shape (1500L,) as below: x = array([ 3.e+01, 6.e+01, 9.e+01, ..., 4.4940e+04, 4.4970e+04, 4.5000e+04]) Now, I wanted to determine the indices of the x values

Re: How can I find the indices of an array with float values in python?

2019-01-10 Thread Madhavan Bomidi
Thank you all for various ways of finding the indices. -- https://mail.python.org/mailman/listinfo/python-list

Levenberg-Marquardt non-linear least-squares fitting in Python

2019-03-28 Thread Madhavan Bomidi
Hi, I have x and y variables data arrays. These two variables are assumed to be related as y = A * exp(x/B). Now, I wanted to use Levenberg-Marquardt non-linear least-squares fitting to find A and B for the best fit of the data. Can anyone suggest me how I can proceed with the same. My

Re: Levenberg-Marquardt non-linear least-squares fitting in Python

2019-03-28 Thread Madhavan Bomidi
Hi Bill, Thanks for your suggestion. Where am I actually using the curve_fit in the defined function func2fit? Don't I need to initial assumption of a, b and c values so that optimized convergence occur with iteration of the function for the input data of x? Look forward to your suggestions,

How to access metadata fields in HDF4 files in Python?

2019-05-22 Thread Madhavan Bomidi
Hi, I have imported the following libraries to access the data sets from a HDF4 file in Python 2.7 from pyhdf.SD import SD, SDC hdf = SD(FILE_NAME, SDC.READ) hdf.datasets() While I don't have any issues in accessing the contents of the data sets, I am unable to access the metadata. I have

How to append horizontally the data array from the FOR loop?

2019-05-10 Thread Madhavan Bomidi
Hi, I have to append requisite data matrix from multiple files into a single variable using FOR loop. outData = []; for file in fileList: allData = # an array of nrows and ncols. outData = [outData; allData] # in MATLAB While the ncols are

How to split a list type array into float array?

2019-05-21 Thread Madhavan Bomidi
Hi, I have the following list type data: [' 29.7963 29.6167 29.4371 29.2574 29.0778 28.8982 28.7185 28.5389 28.3593 28.1797 28. 27.8204 27.6408 27.4611 27.2815 27.1019 26.9223 26.7426 26.5630 26.3834 26.2037 26.0241 25.8445 25.6649 25.4852

How to concatenate strings with iteration in a loop?

2019-05-21 Thread Madhavan Bomidi
Hi, I need to create an array as below: tempStr = year+','+mon+','+day+','+str("{:6.4f}".format(UTCHrs[k]))+','+ \ str("{:9.7f}".format(AExt[k,0]))+','+str({:9.7f}".format(AExt[k,1]))+','+ \ str("{:9.7f}".format(AExt[k,2]))+','+str("{:9.7f}".format(AExt[k,3]))+','+ \

How to sort the files based on the date?

2019-07-15 Thread Madhavan Bomidi
I am using the following command line to sort the files: import glob a = sorted(glob.glob('3RIMG_*.h5') Following is the result: 3RIMG_01APR2018_0514_L2G_AOD.h5 3RIMG_01APR2018_0544_L2G_AOD.h5 3RIMG_01APR2018_0644_L2G_AOD.h5 3RIMG_01APR2018_0714_L2G_AOD.h5 3RIMG_01APR2018_0744_L2G_AOD.h5

Re: How to sort the files based on the date?

2019-07-15 Thread Madhavan Bomidi
Thanks Peter. The following lines worked: import glob import datetime def get_datetime (filename): parts = filename.split ("_") return datetime.datetime.strptime (parts[1] + parts[2], "%d%b%Y%H%M") filenames = sorted(glob.glob('3RIMG _ *. h5'), key = get_datetime) --

Wind Rose Plotting in Python

2019-09-05 Thread Madhavan Bomidi
Hi, Can someone help me on how to make the wind rose plotting (similar to the figure 2 in the paper: https://agupubs.onlinelibrary.wiley.com/doi/epdf/10.1029/2011JD016386) in Python? The input file contains the data in 4 columns: [date, time, wind_speed, wind_direction] Look forward to

How to execute shell command in Python program?

2019-07-20 Thread Madhavan Bomidi
Hi, I have the following shell commands to run my executable created with gfortran: - $ pwd /OPAC/opac31a/opac31 $ ls extback.dat opacopac.f result terr.dat input opac.cfg

Re: How to execute shell command in Python program?

2019-07-23 Thread Madhavan Bomidi
Thanks for your suggestions. I have sorted the issue as follows: import pexpect child = pexpect.spawn('./opac') child.sendline('opac') This works!!! -- https://mail.python.org/mailman/listinfo/python-list

Angular distribution rose diagram in Python

2019-09-27 Thread Madhavan Bomidi
Hi, Can someone help me to make python code (with some arbitrary data) for the angular distribution rose diagram as shown in figure 7 in the paper accessible through the web-link: https://www.nat-hazards-earth-syst-sci.net/17/1425/2017/nhess-17-1425-2017.pdf Thanks in advance Madhavan --

How to convert the following IDL program lines to equivalent Python program lines?

2019-11-28 Thread Madhavan Bomidi
Hi, I have the following IDL program lines. I want to write equivalent Python program lines. Can anyone suggest me equivalent Pythons program lines? # --- 1 --- # How to handle the format in IDL to Python? IDL program line: print,'Column ',J,' of product