Indian Forum for Water Adroit

R vs Python

subash

  • *****
  • Thanked: 32 times
  • +16/-0
    • View Profile
  • Programming language : Python, R and Matlab
R vs Python
« on: December 08, 2016, 05:46:27 PM »
This blog gives a nice intro and comparison between R and Python. Some popular packages and the scripting language to choose for your work are described eloquently.

https://www.datacamp.com/community/tutorials/r-or-python-for-data-analysis#gs.3KXWxKM
 
The following users thanked this post: Karthikeyan L, Diwan

P KABBILAWSH

  • ***
  • Thanked: 28 times
  • +2/-0
    • View Profile
  • Institute : NATIONAL INSTITUTE OF TECHNOLOGY , CALICUT
  • Programming language : R
Re: R vs Python Vs MATLAB
« Reply #1 on: December 22, 2016, 12:10:27 PM »
Since many are working on all the programming languages - MATLAB , R and python.Internet is flooded with so many comparisons with different conclusion from different perspective and i cannot interact either physically or through internet with person or organisation who has posted it  , i have an humble request.Since many are working / have worked/ working on either of one .Please clarify my following doubts
  • According to you which is good for both statistical and Non-statistical analysis?Better based on ur experience can u suggest for what type of problems we should use MATLAB , R & Python Respectively ? Or by learning which language we can solve majority of problems ??
  • Which is easier to Learn, since learning and becoming critically good, like knowing nook and corner in any one of the programming languages  is itself difficult and challenging on ??
  • Is there any you-tube channel or website where they teach these algorithms from the scratch ?
  • Among MATLAB R and Python which has many GIS functionalities ???
  • For Beginners what one has to do, to become extremely good in a specific programming language because the net is flooded with so many teaching modules that we can't check each one and come to a conclusion .If we do so, we shall be left with learning less things with more time invested .
  • Is there  any online certification test conducted by any community testing our potential in MATLAB, R and Python like The GIS Certification[/size] Institute (GISCI) is a non-profit organization that provides the GIS community with a complete certification program, leading to GISPĀ® (Certified GIS Professional) recognition. GISCI offers participants around the world, from the first early years on the job until retirement, a  method of showing competence for professionals and employers in the GIS profession.  We offer the only industry-wide, internationally-recognized,  software-agnostic Certification available to geospatial professional.Similar to it is there any institution which gives complete certification program in any of programming languages ?? IF so what is the language and what is the name of the institution ??? If so how much are they charging ??? By getting such a certification does it increase the employability in a developing country like INDIA ???
 
The following users thanked this post: Sat Kumar Tomer

Sat Kumar Tomer

  • *****
  • Thanked: 28 times
  • +116/-0
    • View Profile
    • ambhas
  • Institute : IISc
  • Programming language : R, Python and Matlab
Re: R vs Python
« Reply #2 on: December 23, 2016, 05:05:24 PM »
Quote
According to you which is good for both statistical and Non-statistical analysis?Better based on ur experience can u suggest for what type of problems we should use MATLAB , R & Python Respectively ? Or by learning which language we can solve majority of problems ??

R and MATLAB are relatively better than Python for advanced statistical analysis. However for most commonly used stat is available in all.
If you learn any one of these, learning others is very easy. So just start with anyone. R and Python are better than MATLAB for handling GIS data. Python is relatively better for handling strings.

Quote
Which is easier to Learn, since learning and becoming critically good, like knowing nook and corner in any one of the programming languages  is itself difficult and challenging on ??
MATLAB has few datatype, so relatively easy to learn.

Quote
Is there any you-tube channel or website where they teach these algorithms from the scratch ?
Search in google and select the video option. You will find lots of videos. I prefer to learn from books. For MATLAB, I prefer: Basics of MATLAB and Beyond by Andrew Knight. For python, you can use Python in hydrology and other books are also mentioned in the forum. Just visit the Python section. For R, we added some notes - you can find in the R section of the forum.

Quote
Among MATLAB R and Python which has many GIS functionalities ???
Answered above.

Quote
For Beginners what one has to do, to become extremely good in a specific programming language because the net is flooded with so many teaching modules that we can't check each one and come to a conclusion .If we do so, we shall be left with learning less things with more time invested .
To learn programming, you need to program a lot. No other shortcut. Whatever assignment/problem you get, try to solve only in that programming language.

Quote
Is there  any online certification test conducted by any community testing our potential in MATLAB, R and Python like The GIS Certification Institute (GISCI) is a non-profit organization that provides the GIS community with a complete certification program, leading to GISPĀ® (Certified GIS Professional) recognition. GISCI offers participants around the world, from the first early years on the job until retirement, a  method of showing competence for professionals and employers in the GIS profession.  We offer the only industry-wide, internationally-recognized,  software-agnostic Certification available to geospatial professional.Similar to it is there any institution which gives complete certification program in any of programming languages ?? IF so what is the language and what is the name of the institution ??? If so how much are they charging ??? By getting such a certification does it increase the employability in a developing country like INDIA ???
My advice, focus on the learning.

When you pose a question, please put it in a separate post.
« Last Edit: December 23, 2016, 05:09:39 PM by Sat Kumar Tomer »
 
The following users thanked this post: Subir Paul, Diwan, denzilroy

subash

  • *****
  • Thanked: 32 times
  • +16/-0
    • View Profile
  • Programming language : Python, R and Matlab
Re: R vs Python
« Reply #3 on: December 23, 2016, 08:43:50 PM »
My views with little experience in all the three scripting languages are as below:

Sat hit the nail on the head by saying learn by coding is the best way to learn any programming language, does'nt matter which you pick. All the programming languages can solve most of the problems but picking which one is the best is very case specific. However, for solving most research problems any one among the three is ok to get started/solve ur problem. Most research students pick MATLAB because it can be very easy to learn. R has very deep learning curve and Python comes in between.

Most of the packages/algorithms in WaterResources you can most likely find in R or MATLAB.

Hello World : You can learn interactive code  @ https://www.codecademy.com/, https://www.codeschool.com/ & https://www.datacamp.com/

ShapeFile/Raster : Coming and Python and R w.r.t GIS, although the core algos in ArcGIS/QGIS/GRASS are written in C, many packages/libraries for GIS are written in Python. As a result you see many packages in Python and R which can talk to arcGIS/QGIS/GRASS. So, if you handle lot of satellite data processing, it is good to go with R/Python.

Rewards : There are many programming courses being offered in https://www.coursera.org/   Matlab/Python/R. Pick any , do the course and you can write it on ur CV.
(2) You can take part in coding challenges which happen everyday/week  https://www.analyticsvidhya.com/ , https://github.com/ and topcoder.com to name a few, you can take part and put  your ranking on the CV.


Finally, It takes about 10 years to master one programming language. But, once you get started with one, you can easily pick the other.

Happy Coding
 
The following users thanked this post: Subir Paul, denzilroy

Karthikeyan L

  • *****
  • Thanked: 55 times
  • +34/-0
  • Research Scholar
    • View Profile
  • Institute : Indian Institute of Science, Bangalore
  • Programming language : Matlab, R
Re: R vs Python
« Reply #4 on: December 29, 2016, 03:31:06 PM »
I think MATLAB can be competent enough for GIS functionality, its just that the toolbox is not well explored. MATLAB has a dedicated MAPPING toolbox. I had a task of plotting spatial maps to present my results and I was not satisfied with the colormaps of R and Python (may be I was not patient enough to edit the preset colormaps to my requirements), this lead me to MATLAB. I presented my findings from toolbox in a MATLAB primer seminar series held at IISc. The following code plots a spatial map of mean daily rainfall (mm) over India. I plotted the same data in R and Python and felt MATLAB produced satisfactory outcome.

Code: [Select]
% Geo-Spatial Plotting in MATLAB using MAPPING Toolbox %

% Unzip data.rar and change directory to unzipped folder; Load requisite data for plot
load data_spatial_mapping.mat;                 
% Read shapefile of India
S = shaperead('India.shp','usegeocoords',true);
% Define map projection
axesm('MapProjection', 'eqdcylin')
% Set map axis limits and labels
setm(gca,'GLineStyle','--', 'GColor',[0.83 0.82 0.78], 'Grid','on','Frame','on')
setm(gca, 'MapLatLimit',[8 37.2],'MapLonLimit',[68 97.5],...
    'MlabelLocation', 5,'MLabelParallel','north', 'MeridianLabel','on',...
    'ParallelLabel','on','MlineLocation',5,'PlabelLocation',4,'PlineLocation',4)
% Plot shapefile of India
geoshow(S.Lat,S.Lon,'LineWidth', 2,'Color',[0 0 0])
% Overlay with data
contour_num=20;
contourfm(lat_mesh,lon_mesh,data_mesh,contour_num);
% geoshow(lat_mesh,lon_mesh,data_mesh,'DisplayType','surface');
colormap hsv;
colorbar('SouthOutSide');
tightmap
xlabel('Mean Daily Rainfall (mm)','FontSize',14)      % Add title to the map

I can say that 'setm' is the heart of this code which sets the requisite parameters of the map.
Functions list in Mapping Toolbox can be found from here: https://in.mathworks.com/help/map/functionlist.html

I would suggest interested people to edit this code and see the changes happening in the map.

I am still interested in learning in detail the 'ggplot2' and other important packages of R that support GIS functionality. Although they are huge, I wish there is some tutorial that covers all the aspects of these packages.
« Last Edit: December 29, 2016, 11:19:30 PM by Karthikeyan L »
 
The following users thanked this post: Subir Paul, Diwan