Posts

PYTHON - OOP(OBJECT ORIENTED PROGRAMMING) - PART 1

Image
  OOP IN PYTHON --  To map with real world scenarios, we started using objects in code. This is called Object Oriented Programming. -- Utilizing functions reduces redundancy and enhances code reusability.  CLASS AND OBJECT IN PYTHON -- Class is a blueprint which tells us that what features should a class have. -- All the information which we have to store in particular object and writing in a class is what we call blueprint for creating an object # First we have to define class   * Creating class   class Student:                (Remember you always have to start class's name by capital letter)         name = "Anshula"     * After creating class, we need to create object Eg: s1 = Student () print(s1.name)     (object and instances of class is same) ** Suppose there is a factory and you are required to create a class. class Car:     color = "blue"     bran...

LEARNING DATA SCIENCE , PART 3

 DATA TYPES IN PYTHON   1. NUMBERS - Integers i.e whole numbers , not decimal 2. FLOAT Floats are the decimal numbers . Example - 4.3 , 5.7  3. Complex Number  x + iy  , here x = real number and y = imaginery 4. Boolean Boolean is either true or false  5. SET  Set is a collection of data Set only contains unique elements , repititions are not allowed. 6. DICTIONARY  It states in the from of key and it's value terms. {name : 'John , Age:'25' , 'city':25 , 'New year'} 7. STRING It is the most commonly used data type. Write in between of commas "   ". 8. LIST  List is collection of items and it can have duplicate items. my_list = [1,2,3,4,5] 9. TUPLES  Tuples are immutable ( means we can not modify the code once written). 10. NONE   When the type of data does not exist that is known as NONE . Now, we will move forward to PYTHON OPERATORS  1. ARITHMETIC OPERATORS #ADDITION (+)  a + b (operand), here a = ope...

LEARNING DATA SCIENCE , WEEK 2

 PYTHON KEYWORDS Python keywords are special reserved words that have specific meanings and purposes and can not be used for anything but those specific purposes. Note: There is a function in python ,when you execute that it will show the list of python keywords. FUNCTION - help('keywords') PYTHON IDENTIFIERS Variable - Anything which holds certain value. The identifier is used to identify an entirely unique in a program at the time of execution. Example - name = 'ANSHULA' name is representing unique identity ANSHULA . There are few rules to define identifiers. 1. Use only alphabets , numbers or underscore. 2. Use of Special characters and keywords is not allowed. 3. Starting characters should be either underscore or alphabets , numbers are not allowed. COMMENT IN PYTHON  Comment is additonal information about the code you have written so that other developer can understand that code, in case he wants to reprogram that code. # - Using this means you are writting a comme...

LEARNING DATA SCIENCE , WEEK 1

  INTRODUCTION TO PROGRAMMING   -WHAT IS PROGRAMMING? There should be a common language so that both human and computer can understand. Programming language is a way to communicate with computer ,humans understands programming and write a code, then computer execute it to follow instructions. PROCEDURAL PROGRAMMING This programming was introduced in 1980s. It is a form of programming in which problem solving involves breaking down the task into sequential steps , with a boolean decision made at each step. Example - C language. To address real life issues it is essential to convert real entities in world of programming. OBJECT - it represents real entities , the object has it's own state and behaviour. RELATIONSHIP - object oriented principles (OOP) represents relationships. PYTHON CONTAINS - 1. Procedural  2. OOP 3. Functional  This is the reason python holds a distinctive positions for mastering data science.

HOW TO USE SQL?

Image
WHY USE SQL (STRUCTURED QUERY LANGUAGE)? While Excel can only handle data containing up to one million row, businesses today generate data in the billions and trillions.To manage such vast amounts of data, databases and indespensable. NOW, HOW TO CREATE TABLES IN SQL? In SQL, we utilize the CREATE command to create tables.. SYNTAX :  CREATE TABLE   "TABLE NAME"( "COLUMN 1"   "data type for column 1" "COLUMN 2"  " data type for column 2" , "COLUMN N"   'data type for column n", [table constraint]); CONSTRAINTS: 1. NOT NULL : Column cannot have null values  2. DEFAULT : Provides a default value. 3. UNIQUE : All values in column are different. 4. CHECK : Makes sure that all values. 5. PRIMARY KEY : It is use to uniquely identify a row in the table. 6.FOREIGN KEY : It is use to ensure referential integreting of data. INSERT COMMAND The INSERT INTO statement is used to add new records into a database table. SYNTAX: --- Sin...

How to create Macros in Excel

Image
 First, we will know what is macro? So it's a program that automates repetitive tasks by recording and replaying a series of steps.  Benefits of using macro ~Saves time ~ Easy to use How to enable Marcos in excel.. Step 1 : Go to home Step 2 : Customize the ribbon Step 3 : Go to main tabs, Select developer. How to record macro  Step 1 : Go to developer ,then click on record macro Step 2 : Type macro's name then select ok (there should not be spaces ). Recording will start.. Stop the recording when the work is done.. When u click on visual and then go to module you will see the actual code which is running behind macro...  You can edit that code as well.  USE OF RELATIVE REFERENCE - The macro will insert a row relative to the cell selected.  Click the  use relative reference  button on the developer tab to toggle relative reference on and off. For saving workbook containing macros, save it as  EXCEL MACRO ENABLED WORKBOOK.  💻