Category: New Python tutorial

python tutorials and learn python

Created with Sketch.

Python String find()

Python String find() Summary: in this tutorial, you’ll learn how to use the Python string find() method effectively to find a substring in a string. Introduction to Python string find() method The find() is a string method that finds a substring in a string and returns the index of the substring. The following illustrates the…
Read more

Python String index()

Python String index() Summary: in this tutorial, you’ll learn how to use the Python string index() method to get the index of a substring in a string. Introduction to Python String index() method The string index() method returns the lowest index of a substring in a string. The following shows the syntax of the index()…
Read more

Python String split()

Python String split() Summary: in this tutorial, you’ll learn how to use the Python String split() method to split a string into a list of substrings. Introduction to the Python string split() method The split() method splits a string and returns a list of substrings. The following shows the syntax of the split() method: str.split(sep=None,…
Read more

7 Ways to Concatenate Strings in Python

7 Ways to Concatenate Strings in Python Summary: in this tutorial, you’ll learn various ways to concatenate strings in Python. Python provides you with various ways to concatenate one or more strings into a new string. Since Python string is immutable, the concatenation always results in a new string. 1) Concatenating literal strings To concatenate…
Read more

Python String join()

Python String join() Summary: in this tutorial, you’ll learn how to use the Python String join() method to concatenate strings in an iterable into one string. Introduction to the Python String join() method The string join() method returns a string which is the concatenation of strings in an iterable such as a tuple, a list,…
Read more

Python String Methods

Python String Methods This section provides you with useful Python string methods that help you manipulate strings more effectively. Concatenating & Splitting strings These methods allow you to concatenate strings into one string and split a string into substrings effectively. Method Description join() Return a string that is the concatenation of strings in an iterable.…
Read more

NumPy split()

NumPy split()   Summary: in this tutorial, you’ll learn how to use the NumPy split() function to split an array into multiple sub-arrays. Introduction to the NumPy split() function The split() funciton splits an array into multiple sub-arrays as views. The syntax of the split() function is as follows: numpy.split(ary, indices_or_sections, axis=0)   In this…
Read more

NumPy hstack()

NumPy hstack() Summary: in this tutorial, you’ll learn how to use the NumPy hstack() function to join two or more arrays horizontally. Introduction to the NumPy hstack() function The hstack() function joins elements of two or more arrays into a single array horizontally (column-wise). The following shows the syntax of the hstack() function: numpy.hstack((a1,a2,…))  …
Read more

NumPy vstack()

NumPy vstack() Summary: in this tutorial, you’ll learn how to use the NumPy vstack() function to vertically join elements of two or more arrays into a single array. Introduction to the NumPy vstack() function The vstack() function joins elements of two or more arrays into a single array vertically (row-wise). Here’s the syntax of the…
Read more

NumPy stack()

NumPy stack() Summary: in this tutorial, you’ll learn how to use the NumPy stack() function to join two or more arrays into a single array. Introduction to the NumPy stack() function The stack() function two or more arrays into a single array. Unlike the concatenate() function, the stack() function joins 1D arrays to be one…
Read more