Saraswat World

WHAT IS ARRAY SLICING IN PYTHON NUMPY?

WHAT IS ARRAY SLICING IN PYTHON NUMPY?

Python

Accessing elements of an array from one given index to another given index is known as slicing in python. Instead of passing index, we pass slice with step – [start:end:step] If we don’t pass start its considered 0 If we don’t pass end its considered length of array in that dimension If we don’t pass […]

HOW TO ACCESS ARRAY ELEMENTS IN PYTHON NUMPY?

HOW TO ACCESS ARRAY ELEMENTS IN PYTHON NUMPY?

Python

Numpy Array Indexing or Accessing Array Elements We can access an array element by referring to its index number. Array indexing is the same as accessing an array element. The indexes in NumPy arrays start with 0. Example- Following example shows that how to access the first element of given array arr. First element of […]

HOW TO CREATE ARRAY USING NUMPY IN PYTHON?

HOW TO CREATE ARRAY USING NUMPY IN PYTHON?

Python

The array object in NumPy is called ndarray. We can create a NumPy ndarray object by using the array() function. We can pass a list, tuple or any array-like object into the array() method, and it will be converted into an ndarray. type(): It is a built-in Python function which returns the type of the object passed to […]

HOW TO INSTALL NumPy ?

HOW TO INSTALL NumPy ?

Python

NumPy Installation- If Python and PIP is already installed on a system, then installation of NumPy can be done by using following command In case if the above mentioned command fails, then use a python distribution that already has NumPy installed like, Anaconda, Spyder etc. NumPy Importing- To import NumPy in our application code use […]

WHAT IS NumPy IN PYTHON?

WHAT IS NumPy IN PYTHON?

Python

NumPy stands for “Numerical Python. NumPy is a open source Python library. NumPy is used for working with arrays. NumPy was created in 2005 by Travis Oliphant. NumPy is written partially in Python, but most of the parts that require fast computation are written in C or C++. NumPy has functions for working in domain […]

HOW TO HANDLE FILES IN PYTHON?

HOW TO HANDLE FILES IN PYTHON?

Python

We can create, read, update and delete files in python. How to open file in python? File Opening in Python- open() method is used to open the file in the python. It has 2 Parameters – filename and mode. There are four different methods (modes) for opening a file: “r” – Read – Default value. […]

Arokiaswamy Velumani

Arokiaswamy Velumani – Built a Rs 7000 Crore Empire from Rs 1 Lakh

News Personalities

Arokiaswamy Velumani is an Indian scientist and entrepreneur. He is the founder, chairman and managing director of Thyrocare Technologies Ltd. a chain of diagnostic and preventive care laboratories headquartered in Navi Mumbai. He worked for BARC for 14 years before setting up Thyrocare with his PF money. From Rs 1 lakh at launch in 1996, […]

Kourtney Kardashian And Travis

Kourtney Kardashian is pregnant

News Personalities

Yes, Kourtney Kardashian is pregnant. She announced her pregnancy on June 17, 2023, at a Blink-182 concert in Los Angeles. She held up a sign that read “Travis I’m pregnant,” and Barker jumped off stage to kiss her. The couple has been married since May 2022. Kardashian has three children from her previous relationship with […]

Personalities

Personalities

Personalities

MEET THE PERSONALITIES

Kourtney Kardashian

Kourtney Kardashian

News Personalities

Kourtney Mary Kardashian is an American media personality, socialite, model, businesswoman, and actress. She is best known for appearing on the reality television series Keeping Up with the Kardashians, Kourtney and Khloรฉ Take Miami, and Kourtney and Kim Take New York. Kardashian was born on April 18, 1979, in Los Angeles, California. She is the […]

WHAT IS THE STRING FORMATTING IN PYTHON?

WHAT IS THE STRING FORMATTING IN PYTHON?

Python

STRING FORMATTING format() method in python is used to format the selected parts of a string by placing the curly braces {} as placeholder on the selected part of string, which we want to get filled by values provided from user input or database, and running the values through format() method. Example- Add a placeholder/{} […]

HOW TO GET INPUT FROM USER IN PYTHON?

HOW TO GET INPUT FROM USER IN PYTHON?

Python

User Input in Python using input() method- The following example asks for the username, and when you entered the username, it gets printed on the screen. Python stops executing when it comes to the input() function, and continues when the user has given some input.

WHAT IS PYTHON TRY EXCEPT?

WHAT IS PYTHON TRY EXCEPT?

Python

TRY and EXCEPT block is used in the code for the exception handling. Exception Handling Whenever an error or exception occur in our code while executing, the Python will normally stop and generate an error message. These exceptions can be handled using the try statement. The try block is used for testing a block of […]

WHAT IS PYTHON PIP?

WHAT IS PYTHON PIP?

Python

PIP is a package manager for python packages or modules, it is used to install the additional libraries and packages that are not part of the standard Python library. How to install pip? pip comes pre-installed on the Python versions 3.4 or older. We can check if pip is installed by using the following command […]

WHAT IS PYTHON RegEx AND HOW TO SEARCH USING PYTHON?

WHAT IS PYTHON RegEx AND HOW TO SEARCH USING PYTHON?

Python

RegEx in Python RegEx stands for Regular Expression. It is a sequence of characters that form a search pattern. RegEx or search pattern can be used to check if a string contains the specified search pattern. Python has a built in package or module called re which can be imported in python code to work […]

WHAT IS PYTHON JSON?

WHAT IS PYTHON JSON?

Python

JSON- Stands for Java Script Object Notation, JSON is an open standard text based data interchange format which is easy for machines to parse and generate. JSON in python Python has a built in package called json. json module can be imported in python to work with json data as shown below. To Convert data […]

WHAT IS DATETIME MODULE IN PYTHON?

WHAT IS DATETIME MODULE IN PYTHON?

Python

Python Datetime Module Python Datetime Module in Python provides us the different features to work with dates as date object by importing the datetime module. Current Date Python code to import the datetime module to access current date output (Note-it will show the current date and time, at the time of execution of code on your machine) […]

WHAT IS POLYMORPHISM IN PYTHON?

WHAT IS POLYMORPHISM IN PYTHON?

Python

PYTHON POLYMORPHISM Polymorphism is one of the OOP(object-oriented programming) concepts. Polymorphism in Python is the ability of an object to take many forms. The word โ€œpolymorphismโ€ means โ€œmany formsโ€, and in programming, it refers to methods/functions/operators with the same name that can be executed on many objects or classes. Function Polymorphism in Python In Python […]

WHAT IS A PYTHON MODULE?

WHAT IS A PYTHON MODULE?

Python

PYTHON MODULE Module is a file or library of codes or set of methods, that can be included in our Application. HOW TO CREATE A MODULE? Creating Module- Module can be created by saving the code in a file with the file extension .py. Python Code- Save below code in file named mymodule.py Using Module- […]

WHAT IS PYTHON ITERATOR?

WHAT IS PYTHON ITERATOR?

Python

PYTHON ITERATORS An Iterator is an object that contains a countable no. of values or elements that can be traversed. An iterator allows a programmer to traverse through all the elements of a collection or iterable objects. An iterator is an object which implements the iterator protocol, which consist of the methods __iter__() and __next__(). WHAT […]