Sunday 7 October 2018

Basics of Calculations_Calculator_Built in Function Assignments

Integer Division %/%

Integer Division :  Division in which the fractional part (remainder) is discarded

> c (2, 3, 5, 7)  % / %  c(2,3)

[1]  1  1  2  2



Modulo Division (x mod y)  %%:

x mod y : modulo operation finds the remainder after division of one number by another

> c (2,3,5,7)  %% 2
  [1]  0  1  1  1



Maximum: max



Maximum: min




Overview Over Further Functions



Example :

> abs ( -4)
  [1] 4

> abs (c(-1, -2, -3, 4, 5) )
 [1]  1  2  3  4  5
> sqrt (4)
  [1]  2

> sqrt ( c(4,9,16,25) )
  [1]  2  3  4  5

 
 > sum (c(2,3,5,7) )
  [1]  17

> prod ( c( 2,3,5,7) )
  [1]   20

> round  (1.23)
  [1]  1

> round (1.83)
  [1]  2



Assignments

Assignments can be made in two ways:

>  x<-6
>  x
    [1]   6

> mode(x)
  [1]  "numeric"

> x=8
> x
   [1]   8

>  mode (x)
    [1]  "numeric"


An assignments can also be used to save values in variables:

>  x1  <-  c(1,2,3,4)

>  x2  <-  x1^2

>  x2
  [1]  1  4  9  16

ATTENTION: R is case sensitive (X is not the same as x

Friday 5 October 2018

Top 10 Reasons to Learn Python

1. Simple & Easy To Learn
  • Open Source
  • High-level
  • Interpreted
  • Large community
2. Portable & Extensible



3. Web Development
  • Develop web applications
  • Scrape websites
Frameworks
 - django
 - Flask
 - Pylons
 - WEB2PY

4. Artificial Intelligence

  Libraries
      - Scikit-learn
      - Keras
      - Tensorflow
      - Opencv


5. Computer Graphics
  • Graphical User Interface
  • Desktop applications
  • Game development
Libraries
   - Tkinter
   - Jython
   - wxPython
   - PYGAME

6. Testing Frameworks
  • Python supports testing with cross-platform & cross-browser.
  • Built in testing framework which covers debugging time and fastest workflows.
Tools :- Splinter
Framework :- Pytest

7. Big Data
  • Python handles BIG DATA!
  • Python supports parallel computing
  • You can write MapReduce codes in Python
Libraries
    - PYDOOP
    - DASK
    - PySpark

8. Scripting: Automation
  • It is the most popular scripting language in the industry
  • Automate certain tasks in a program
  • They are interpreted rather being compiled
 Scripts → Machine reads & interprets → Runtime error check


 9. Data Science
  • Well-suited for data manipulation & analysis
  • Deals with tabular data with heterogeneously-typed columns
  • Arbitrary matrix data
  • Observational/statistical datasets
Libraries
    - NumPy
    - Pandas
    - matpltlib
    - Seaborn

10.  Popularity & High Salary


    USD  $ 116,028

Java vs Python Comparison

Java :-

It is a fast, secure and reliable general purpose computer programming language.

Python :-

A Readable, efficient and powerful high level programming language.




1. Speed

Java 
    → Statically Typed and Faster than Python
Python
    → Dynamically typed and Slower than Java.

2. Legacy :-

Java 
    → Java legacy systems are typically larger and numerous
Python
    → Python has less legacy problem

3. Code

Java
    → Longer lines of code when compared to Python
Python
    → Shorter Lines of code when compared to Java

4. Databases

Java
     → Most popular and widely used database
Python
      → Access layers are weaker than Java's JDBC

5. Practical Agility

Java
       → Popular for mobile and web applications
Python
        →  Popular for Data Science, ML, AI and IoT.

6. Trends



7. Salary 




8. Syntax 

Basic Differences

Java
     → Java is a compiled language.
     → Java is an object oriented programming language.
     → Java is statically typed.
Python
     → Python is an interpreted language.
     → Python is a scripting language.
     → Python is dynamically typed.

Number of  Lines

Java
        public class HelloWorld {
             public static void (string[] args)  {
                   // print "Hello World" to the terminal window.
                   System.out.println("Hello, World");
              }
       }
Python
             The program prints Hello, World!
          print ("Hello, World!");

 Semicolon

Java
              class Programming  {
                    // constructor method
                Programming ( )  {
                  System.out.println ("constructor method called");
                       }
                public static void main(string[ ] args)  {
                  Programming object = new programming ( );
                  }
             }
Python
                class Student:
                   # Constructor - Parametrized
                   def _int_(self, name):
                    print ("This is parametrized constructor")
                       self.name = name
                    def show (self)
                      print ("Hello", self.name)
                student = Student ("Irawen")
                   student.show( )

Indentation

Tuesday 2 October 2018

Top 10 Python Libraries

1. Pandas

Pandas is a software library written for the python programming language for data manipulation and analysis.

Pandas is well suited for many different kinds of data:
  • Tabular data with heterogeneously-types columns.
  • Ordered and unordered time series data.
  • Arbitrary matrix data with row and column labels.
  • Any other form of observational / statistical data sets.
 The data actually need not be labeled at all to be placed into a pandas data structure.

2. NumPy

Numpy is the core library for scientific computing in Python. It provides a high-performance multidimensional array object, and tools for working with these arrays.



3. Matplotlib

Matplotlib is a Python package used for 2D graphics.
  • Bar graph
  • Histograms
  • Scatter Plot
  • Pie Plot
  • Hexagonal Bin Plot
  • Area Plot


4. Selenium

The selenium package is used to automate web browser interaction from Python.

5. OpenCV

OpenCV- Python is a library of Python designed to solve computer vision problems.

6. SciPy

Scipy is a free and open-source Python library used for scientific computing and technical computing.



7. Scikit-Learn

Scikit-learn (formerly scikits.learn) is a free software machine learning library for the Python programming language. It features various classification, regression and clustering algorithms.

8.  PySpark

The Spark Python API (PySpark) exposes the Spark programming model to Python.




9. Django

Diango is a Python web framework. A framework provides a structure and common methods to make the life of a web application developer much easier for building flexible, scalable and maintainable web applications
  • Django is a high-level and has a MVC-MVT styled architecture.
  • Django web framework is written on quick and powerful Python language.
  • Django has a open-source collection of libraries for building a fully functioning web application.

10. Tensor Flow

TensorFlow is a Python library used to implement deep networks. In TensorFlow, computation is approached as a dataflow graph.

Monday 1 October 2018

Introduction to Computating & Problem Solving with Python



This book will help every student, teacher and researcher to understand the computing basics and advanced Python Programming language. The Python programming topics include the reserved keywords, identifiers, variables, operators, data types and their operations, flowcontrol techniques which include decision making and looping, modules, files and exception handling techniques. More than 300 solved lab exercises available in this book is tested in Python 3.4.3 version for Windows. The book covers syllabus for more than 35 International Universities and 45 Indian universities. 

Table of Contents 

1: Introduction to computers
2: Program Logic and flow Charts
3: Introduction to Python
4: Data Types and Operations
5: Flow Control
6: Functions
7: Modules and Packages
8: File Handling
9: Object Oriented Programming
10: Exception Handling
11: Regular Expressions
12: Database Programming





About the Author

Jeeva Jose completed Ph. D. in Computer Science from Mahatma Gandhi University, Kerala, India and is a faculty member at BPC College, Kerala. Her passion is teaching and areas of interests include world wide web, Data Mining and Cyber laws. She has been in higher education for the last 15 years and has completed three research projects funded by UGC and KSCSTE. She has published more than twenty research papers in various refereed journals and conference proceedings. She has edited three books and has given many invited talks in various conferences. She is a recipient of ACM-W Scholarship provided by Association for Computing Machinery, New York. P. Sojan Lal was awarded PH. D. from Cochin University of Science and technology, kerala, India. He is Professor, department of computer science and engineering, MBITS, kerala, India and Research supervisor for PH. D. programs of University of petroleum & Energy Studies, Dehardun, India as well as school of computer science, Mahatma Gandhi University, kerala, India. He has 29 Years of academic and industrial experience with 60 publications inclusive of two technical books. His joint publications are recorded with world records India (2014) for most number of papers in several international technical journals within short duration. He has also obtained MBA from starthclyde Business School, Scotland, UK and is a fellow of the Institution of engineers (FIE-India). He was the district Operationg Board member for ASME, Middle east and Africa region. He is a member of ISTE, ASME, IEEE, CSI and engineering Council (UK). He is listed in marquis who's who in the world since 2009 as the biographical reference representing the world's most accomplished individuals.

Core Python Programming by R. Nageswara Rao (Author)



At present, Java occupies number 1 rank as the most used programming language since almost all the projects are developed in Java. Python is already occupying 2nd to 4th position and will be the most demanded language after Java in near future. Python is used with other programming languages on Internet as well as for developing standalone applications. Python programmers are paid high salaries in the software development industry. Hence, it is time for beginners as well as existing programmers to focus their attention on Python.

.








Introduction_Command line_Data editor_Rstudio in R languages

Command Line versus Scripts



Execution of commands in R is not menu driven. (Not like Clicking over buttons to get outcome)

we need to type the commands.

Single line and multi line commands are possible to write.

When writing multi-line programs, it is useful to use a text editor rather than execute everything directly at the command line.

Option 1:
  • One way use R's own built-in editor.
  • It is accessible from the RGui menu bar.
  • Click File and then click on New script
 
At this point R will open a window entitled Untitled-R Editor.

We may type and edit in this.

It we want to execute a line or a group of lines, just highlight them and press Ctrl+R.


Option 2:

Use R studio software


Suppose we want to use following three functions:

Type them.
library (MASS)
attach (bacteria)
fix (bacteria)

Suppose we want to run only function: library (MASS)

Highlight it and click on Run.



Data Editor
  • There is a data editor within R that can be accessed from the menu bar by selecting Edit/Data editor.
  • Provide the name of the matrix or data frame that we want to edit and a Data Editor window appears.
  • Alternatively we can do this from the command line using the fix function. 
Example:
  library (MASS)
  attach (bacteria)
  fix (bacteria)


We can do it in R Studio as follows :




Cleaning up the Windows
  • We assign names to variables when analyzing any data.
  • It is good practice to remove the variable names give to any data frame at the end each session in R.
  • This way, variable with same names but different properties will not get in each others way in subsequent work.
  • rm ( ) command removes variable name
  • For example,
           rm (x, y, z) removes the variable x, y and z.
  • detach ( ) command detaches objects from the Search Path.
  • It removes it from the search ( ) path of available R objects.
  • Usually this is either a data.frame which has been attached or a package which was attached by library.
  • To get rid of everything, including data frames, type rm (list=1s( )  ).

Saturday 29 September 2018

Array, Strings and Functions in R Languages

Array 
  • Used to store ordered list of values of same type.
We will see how to:
  • Create Array
  • Access Array
  • Modify Array





Functions :-
  •  Function is a set of statements combined together perform a specific Task.
  • Syntax:
                 functionName <- function(Arguments_optional)
                   {
                       //Statemnts.
                      }
  • We will see how to:
                 - Create a Function
                 - Call a Function




String :-  
  •  Values written inside single or double quotes are called strings. E.g. "Hello" , 'hello'
  • Quotes can't be mixed, if a string has double quote in beginning ending quotes should be same as well.
  • Example of  Valid strings and invalid strings.
  • "Hey", 'Hey', "Teacher's", 'Name" is' are valid strings.
  • 'Hey", "Hello" there", 'hey"there', are invalid strings.
  • We will see how to:
             - Create and manipulate strings using predefined functions.

Popular Posts

Categories

AI (27) Android (24) AngularJS (1) Assembly Language (2) aws (17) Azure (7) BI (10) book (4) Books (117) C (77) C# (12) C++ (82) Course (62) Coursera (179) coursewra (1) Cybersecurity (22) data management (11) Data Science (94) Data Strucures (6) Deep Learning (9) Django (6) Downloads (3) edx (2) Engineering (14) Excel (13) Factorial (1) Finance (5) flutter (1) FPL (17) Google (19) Hadoop (3) HTML&CSS (46) IBM (25) IoT (1) IS (25) Java (92) Leet Code (4) Machine Learning (44) Meta (18) MICHIGAN (5) microsoft (3) Pandas (3) PHP (20) Projects (29) Python (747) Python Coding Challenge (221) Questions (2) R (70) React (6) Scripting (1) security (3) Selenium Webdriver (2) Software (17) SQL (40) UX Research (1) web application (8)

Followers

Person climbing a staircase. Learn Data Science from Scratch: online program with 21 courses