Numpy

NPTEL-NOC IITM
12 Oct 202220:03

Summary

TLDRThe lecture introduces the NumPy library, emphasizing its importance for numerical operations in Python. It covers the creation and manipulation of arrays, explaining how to process multi-dimensional data efficiently. The instructor demonstrates various functions like reshaping, indexing, and mathematical operations on arrays. The tutorial also touches on nested lists and how to convert them into NumPy arrays, showcasing the library's capabilities for scientific computing.

Takeaways

  • 😀 The lecture introduces the NumPy library, a fundamental package for numerical operations in Python.
  • 📚 NumPy arrays are used for efficient processing of multi-dimensional data and are integral to scientific computing in Python.
  • 🔢 The script explains how to create and manipulate arrays, including reshaping and accessing elements, which is crucial for data analysis.
  • 💻 The tutorial demonstrates installing the NumPy library, a prerequisite for using its functionalities in any Python environment.
  • 🎯 The use of specific functions like `np.array()` is highlighted for creating arrays, emphasizing the need for correct data types.
  • 📊 The lecture covers how to perform mathematical operations on arrays, such as addition, subtraction, and multiplication, which are essential for data manipulation.
  • 🔄 The concept of array reshaping is introduced, allowing for the transformation of array dimensions, which is useful for certain data processing tasks.
  • 📈 The script also touches on more advanced topics like nested lists and the creation of multi-dimensional arrays for complex data structures.
  • 🛠️ Practical examples of array operations are provided, such as calculating the sum or mean of array elements, which are common in data analysis.
  • 🔍 The lecture concludes with insights on how NumPy arrays can be used for mathematical and logical operations on multi-dimensional data.

Q & A

  • What is the primary focus of the lecture?

    -The primary focus of the lecture is to introduce the NumPy library, explain its significance, and demonstrate how to utilize it for numerical operations and processing multi-dimensional data arrays in Python.

  • What does the NumPy library stand for?

    -NumPy stands for Numerical Python, and it is a library that provides support for large, multi-dimensional arrays and matrices, along with a large collection of high-level mathematical functions to operate on these arrays.

  • Why is NumPy important for scientific computing in Python?

    -NumPy is important for scientific computing in Python because it provides an efficient array object and tools for working with arrays, which are fundamental for various types of numerical computations and data processing tasks.

  • What is the difference between a Python list and a NumPy array?

    -A Python list is a built-in data structure that can hold a collection of items, which can be of different data types. A NumPy array, on the other hand, is a homogenous data type that is more compact and efficient in terms of memory usage and performance, making it suitable for large data sets.

  • How can one create a NumPy array?

    -One can create a NumPy array by using the `np.array` function, which converts a Python list or a tuple into a NumPy array. Additionally, one can also create arrays using functions like `np.zeros`, `np.ones`, or `np.arange` for more specific use cases.

  • What are the benefits of using NumPy arrays over Python lists for numerical operations?

    -NumPy arrays offer several benefits over Python lists for numerical operations, including faster execution due to internal optimizations, less memory consumption due to homogeneous data types, and the ability to perform vectorized operations, which allow element-wise operations without the need for explicit loops.

  • How can you reshape a NumPy array?

    -You can reshape a NumPy array using the `reshape` method, which allows you to change the shape of the array without altering its data. The method requires a tuple specifying the new dimensions as an argument.

  • What is the significance of the 'ndarray' object in NumPy?

    -The 'ndarray' object in NumPy is a multi-dimensional array that is the primary data structure in NumPy, providing an efficient way to store and operate on large amounts of data. It supports operations like slicing, reshaping, and broadcasting.

  • How can you install the NumPy library if it's not already available in your Python environment?

    -You can install the NumPy library using a package manager like pip. The command to install NumPy is `pip install numpy`, which can be executed in a terminal or command prompt.

  • What are some common mathematical operations that can be performed using NumPy functions?

    -Common mathematical operations that can be performed using NumPy functions include addition, subtraction, multiplication, division, and more advanced operations like exponentials, logarithms, and trigonometric functions. These operations can be vectorized to act on entire arrays at once.

  • How does NumPy handle broadcasting in array operations?

    -NumPy's broadcasting feature allows operations on arrays of different shapes. During an operation, NumPy compares the dimensions of the arrays and executes the operation by 'broadcasting' the smaller array across the larger one, filling in missing dimensions with copies of the smaller array's data.

Outlines

00:00

📚 Introduction to NumPy

The speaker welcomes the audience to a lecture on NumPy, a fundamental library for numerical operations in Python. The talk focuses on how to utilize the NumPy library for various numerical tasks, emphasizing its role in data processing with multi-dimensional arrays. The speaker introduces the NumPy library as a package in Python that facilitates numerical computations, mentioning its ability to handle multiple data types and support operations on arrays. The lecture also covers the concept of arrays in Python and how they are used to store collections of data. The speaker explains the creation of arrays and the importance of data type consistency within them, providing examples of how to create arrays using the NumPy library and access their properties such as shape and size.

05:01

🔢 Exploring NumPy Arrays

The speaker delves into the creation and manipulation of NumPy arrays, explaining how to define arrays with specific data types and shapes. They demonstrate the use of the 'array' function to create arrays and discuss how to specify data types explicitly. The lecture continues with examples of how to access and modify array elements, reshape arrays, and calculate the total number of elements. The speaker also touches on the concept of array dimensions and how to use them to access array elements efficiently. They conclude by showing how to perform operations like addition and multiplication on arrays using both the '+' operator and the 'add' function, highlighting the versatility of NumPy in handling numerical computations.

10:01

🧩 Advanced Array Operations

The speaker introduces advanced operations on NumPy arrays, such as reshaping and nested arrays. They explain how to reshape arrays using the 'reshape' function and discuss the importance of providing the correct number of elements. The lecture includes a demonstration of creating nested arrays from Python lists and how to access elements within these structures. The speaker also covers the creation of arrays using the 'arange' function, which generates a range of values, and the 'linspace' function, which creates arrays with evenly spaced values within a specified range. They conclude by discussing the use of the 'range' function in NumPy and how it differs from Python's built-in range function, emphasizing its role in creating sequences of numbers for array operations.

15:02

📊 NumPy Functions and Applications

The speaker concludes the lecture by discussing various NumPy functions and their applications on arrays. They demonstrate how to use functions like 'sum', 'min', and 'max' to perform aggregate operations on arrays and how to use the 'mean' and 'median' functions for statistical analysis. The lecture also covers the use of logical operators and functions for conditional operations on arrays. The speaker provides examples of how to apply these functions to arrays and how to combine them with other array operations. They conclude by summarizing the benefits of using NumPy for handling multi-dimensional data and performing mathematical and logical operations, thanking the audience for their attention.

Mindmap

Keywords

💡NumPy

NumPy, which stands for Numerical Python, is a fundamental package for scientific computing in Python. It is used for working with arrays and matrices, and for performing various mathematical and logical operations on them. In the context of the video, NumPy is introduced as a library that is essential for handling numerical operations in Python, and it is used to demonstrate how to create and manipulate arrays, which are the core data structures in NumPy.

💡Array

An array in the context of the video refers to a grid of values, all of the same data type, and is the primary data structure used in NumPy. Arrays can be multi-dimensional, and the video explains how to create and manipulate these arrays using NumPy functions. The concept of arrays is central to the video's theme as it demonstrates the creation of arrays using the 'array' function in NumPy and how they can be reshaped and accessed.

💡Dimension

Dimension in the video refers to the number of axes or the number of indices required to access each element in an array. For example, a one-dimensional array (or vector) is accessed by a single index, while a two-dimensional array (or matrix) requires two indices. The video discusses how to specify dimensions when creating arrays and the importance of dimensions in reshaping arrays using functions like 'reshape'.

💡Shape

Shape in the video is used to describe the dimensions of an array. It is a tuple of integers indicating the size of an array in each dimension. The video explains how to inspect and modify the shape of an array, which is crucial for data manipulation and processing. For instance, the 'reshape' function in NumPy is used to change the shape of an array without altering its data.

💡Installation

Installation in the video pertains to the process of adding the NumPy library to a Python environment. It is mentioned as a prerequisite for using NumPy's functionalities. The video provides a brief demonstration on how to install NumPy using the command 'pip install numpy' in a terminal or command prompt, which is essential for setting up the environment to use NumPy arrays and functions.

💡Function

In the video, a function refers to a reusable block of code that performs a specific task. NumPy provides various functions for creating and manipulating arrays. For example, the 'array' function is used to create an array, and 'reshape' is used to change its shape. The video emphasizes the use of these functions to demonstrate the practical application of NumPy in array operations.

💡Data Type

Data type in the video refers to the kind of data that an array can hold, such as integers, floating-point numbers, or more complex data structures. The video explains how to specify the data type when creating an array, which is important for ensuring that the array can store the intended kind of data. The 'dtype' parameter in the 'array' function is used to define the data type of the array elements.

💡Indexing

Indexing in the video is the method used to access the elements of an array. It involves using indices to pinpoint the location of an element within an array's structure. The video demonstrates how to use indexing to access, assign, and manipulate specific elements or slices of an array, which is a fundamental operation in array manipulation.

💡Broadcasting

Broadcasting is a concept in the video that allows NumPy to perform arithmetic operations on arrays of different shapes. It involves automatically 'broadcasting' or stretching a smaller array so it has compatible shapes for an operation with a larger array. The video touches upon broadcasting as a way to perform element-wise operations between arrays without the need for them to have the same shape.

💡Computational Efficiency

Computational efficiency in the video refers to the ability of NumPy to perform operations on arrays quickly and with minimal resource usage. This is achieved through NumPy's internal optimizations and use of low-level code. The video implies the importance of computational efficiency when it discusses why NumPy is preferred over native Python lists for numerical computations, especially with large datasets.

💡Library

A library in the video is a collection of code, functions, and tools that can be used in a program. NumPy is introduced as a library that extends Python's capabilities for numerical and array operations. The video emphasizes the importance of libraries in enhancing programming functionality and how NumPy, in particular, provides a rich set of functions for mathematical operations on arrays.

Highlights

Introduction to NumPy library and its significance in numerical computations.

Explanation of how NumPy is used for various numerical operations and its role in Python's scientific computing.

Description of NumPy as a fundamental package for numerical computations in Python.

Highlight of NumPy's ability to process multi-dimensional data and support various data types.

Mention of previous lectures covering Python lists and arrays.

Explanation of the difference between Python lists and NumPy arrays in terms of data storage and functionality.

Advantages of using NumPy arrays over Python lists for numerical computations.

Introduction to the concept of indexing in NumPy arrays and how it differs from Python lists.

Explanation of how to create a NumPy array and its data type determination.

Instructions on how to install the NumPy library using pip.

Demonstration of creating a NumPy array using the 'array' function and its syntax.

Description of how to access elements in a NumPy array using indices and slicing.

Explanation of the shape and dimensions of a NumPy array and how to manipulate them.

Introduction to the concept of reshaping arrays in NumPy and its practical applications.

Explanation of the 'reshape' function in NumPy and how it changes the array dimensions.

Discussion on the importance of specifying the correct data type when creating NumPy arrays.

Introduction to the 'range' function in NumPy and its use for generating sequences of numbers.

Explanation of the 'arange' function's parameters and its default behavior.

Demonstration of creating a sequence using 'arange' and its inclusive and exclusive parameters.

Explanation of how to perform arithmetic operations on NumPy arrays using the '+' operator and the 'add' function.

Introduction to the concept of nested lists in Python and their conversion to NumPy arrays.

Explanation of how to perform arithmetic operations like addition and subtraction on NumPy arrays.

Discussion on the use of functions like 'sum', 'mean', and 'median' on NumPy arrays.

Conclusion and summary of the benefits of using NumPy arrays for multi-dimensional data processing.

Transcripts

play00:14

NumPy పై ఉపన్యాసానికి స్వాగతం.

play00:16

ఈ ఉపన్యాసంలో మనం చూడబోతున్నాం లైబ్రరీల

play00:19

గురించి మరియు కొన్ని పనులు చేయడానికి

play00:22

నంబర్ లైబ్రరీని ఎలా ఉపయోగించవచ్చో

play00:25

చూద్దాము.

play00:26

దానిపై సంఖ్యాపరమైన కార్యకలాపాలు.

play00:27

కాబట్టి, ఇది మన రాబోయే ఉపన్యాసాలలో ఉపయోగపడుతుంది.

play00:30

నేను మీకు నంపీ లైబ్రరీని పరిచయం చేస్తున్నాను,

play00:34

ప్రాథమికంగా నంపీ అనేది పైథాన్ ప్యాకేజీ

play00:37

మరియు ఇది ఇది సంఖ్యా పైథాన్ను సూచిస్తుంది,

play00:40

ఇది పైథాన్లో సంఖ్యా గణనల కోసం ప్రాథమిక

play00:44

ప్యాకేజీ.

play00:45

కాబట్టి, మీరు ఏదైనా సంఖ్యాపరమైన ఆపరేషన్లు

play00:47

చేయాలనుకుంటే, అప్పుడు నంపీ లైబ్రరీ ఉపయోగించబడుతుంది

play00:50

మరియు ఇది బహుళ-డైమెన్షనల్ డేటాను ప్రాసెస్

play00:53

చేయడానికి ఉపయోగించగల n డైమెన్షనల్ అర్రే

play00:56

వస్తువులకు మద్దతు ఇస్తుంది మరియు ఇది

play00:59

వివిధ డేటా రకాలకు మద్దతు ఇస్తుంది.

play01:02

మేము ఇప్పటికే మా మునుపటి ఉపన్యాసాలలో

play01:05

పైథాన్ శ్రేణులను చూశాము అర్రే అంటే

play01:08

ఏమిటో గుర్తుందా?

play01:10

శ్రేణి అనేది ఒకే డేటా రకం విలువలను

play01:13

నిల్వ చేసే డేటా నిర్మాణం.

play01:16

కాబట్టి, మీరు ..అయితే ఒక శ్రేణిని సృష్టిస్తున్నప్పుడు

play01:20

శ్రేణిలోని అన్ని మూలకాలు ఒకే డేటా-రకానికి

play01:23

చెందినవిగా ఉండాలి.

play01:24

సంబంధిత విలువలను కలిగి ఉండే జాబితా

play01:27

అనే మరొక కంటైనర్ను కూడా మనం చూశాము.

play01:31

వివిధ డేటా రకాలు.

play01:33

కానీ పైథాన్లోని శ్రేణులు 'పైథాన్'

play01:35

కు సంబంధించిన విలువలను మాత్రమే కలిగి ఉంటాయి.

play01:39

అదే డేటా రకం.

play01:41

కాబట్టి, పైథాన్ శ్రేణులు అంటే ఏమిటో

play01:44

మనకు ఇప్పటికే పరిచయం చేయబడింది.

play01:46

; ఈ ఉపన్యాసంలో నంపీ అర్రేను ఉపయోగించడం

play01:49

వల్ల కలిగే ప్రయోజనాలు ఏమిటో మనం చూడవచ్చు.

play01:53

ఒక నంపీ శ్రేణి గ్రిడ్ను అమర్చుతుంది అన్ని

play01:57

విలువలు ఒకే డేటా రకం మరియు ప్రతికూలం

play02:01

కాని పూర్ణాంకాల టుపుల్ ద్వారా ఇండెక్స్

play02:04

చేయబడతాయి.

play02:05

మరియు పైథాన్లో శాస్త్రీయ కంప్యూటింగ్ కోసం

play02:08

ప్రధాన గ్రంథాలయాలలో నంపీ ఒకటి మరియు

play02:11

ఇది అధిక-పనితీరు గల బహుళ-డైమెన్షనల్

play02:13

అర్రే వస్తువును కూడా అందిస్తుంది

play02:16

మరియు శ్రేణులపై సంఖ్యా గణిత మరియు

play02:19

తార్కిక కార్యకలాపాలను ఉపయోగించడం ద్వారా

play02:21

నిర్వహించవచ్చు.

play02:22

కాబట్టి, అందుకే మేము పైథాన్లో అంతర్నిర్మిత

play02:25

శ్రేణుల కంటే నంపీ శ్రేణులను ఉపయోగించడానికి

play02:28

ఇష్టపడతాము.

play02:29

కాబట్టి, పైథాన్లో శ్రేణి యొక్క కొలతల

play02:32

సంఖ్యను శ్రేణి యొక్క ర్యాంక్ అంటారు.

play02:35

మరియు ప్రతి పరిమాణం వెంట శ్రేణి యొక్క

play02:39

పరిమాణాన్ని ఇచ్చే పూర్ణాంకాల టుపుల్ను

play02:41

'అని పిలుస్తారు.

play02:42

శ్రేణి యొక్క ఆకారం.

play02:44

కాబట్టి, ఒకసారి మీరు ఒక శ్రేణిని

play02:47

కలిగి ఉంటే, మీరు దానిని చూడాలనుకుంటే

play02:51

దాని ఆకారం అప్పుడు అది మీకు పరిమాణాన్ని

play02:54

ఇచ్చే పూర్ణాంకాల విద్యార్థి ఇవ్వబోతోంది

play02:57

ప్రతి కొలత వెంట శ్రేణి.

play02:59

మనకు తెలిసినట్లుగా, నంపీ అధిక పనితీరును

play03:02

అందిస్తుంది బహుళ డైమెన్షనల్ అర్రే

play03:05

ఆబ్జెక్ట్.

play03:06

మరియు నంపీ శ్రేణులలోని మూలకాలను చదరపు ఉపయోగించి

play03:09

యాక్సెస్ చేయవచ్చు.

play03:11

ఇతర తొలగింపు వంటి బ్రాకెట్లు మరియు

play03:14

దీనిని సమూహ పైథాన్ జాబితాను ఉపయోగించడం

play03:17

ద్వారా ప్రారంభించవచ్చు.

play03:18

కానీ శ్రేణులను సృష్టించడానికి అనేక మార్గాలు ఉన్నాయి,

play03:22

ఉదాహరణకు మీరు ఒక శ్రేణిని సృష్టించవచ్చు.

play03:25

సాధారణ పైథాన్ జాబితా నుండి శ్రేణి లేదా

play03:29

శ్రేణి ఫంక్షన్ను ఉపయోగించి టుపుల్

play03:31

చేయండి.

play03:32

నేను ఒక ..సృష్టిస్తున్నాను 1 నుండి 6 వరకు విలువలను

play03:37

కలిగి ఉన్న జాబితా మరియు జాబితా పేరు

play03:40

నా జాబితా మరియు చదరపు బ్రాకెట్ల

play03:44

లోపల విలువలు జతచేయబడిన అవుట్పుట్ను మీరు

play03:47

చూడవచ్చు.

play03:48

కాబట్టి, నంపీ శ్రేణిని సృష్టించడానికి

play03:50

మనం మొదట నంపీ ప్యాకేజీని దిగుమతి చేసుకోవాలి.

play03:54

పెట్టడానికి ముందు కూడా నంపీ ప్యాకేజీ

play03:57

కోసం మీరు మీ మెషీన్లో నంపీ లైబ్రరీని ఇన్స్టాల్

play04:01

చేసి ఉండాలి దీన్ని మీ స్పైడర్ లో లేదా

play04:05

ఏదైనా IDE 's.. లో దిగుమతి చేసుకోండి; కాబట్టి,

play04:09

నంపీ ప్యాకేజీని ఎలా ఇన్స్టాల్ చేయాలో

play04:12

చూద్దాం.

play04:13

కాబట్టి, మీరు దానిని ఉపయోగించడానికి

play04:15

నంపీని ఇన్స్టాల్ చేయాలి.

play04:17

కాబట్టి, . మీరు టెర్మినల్కు వెళ్లడం ద్వారా లేదా

play04:21

కమాండ్ ప్రాంప్ట్కు వెళ్లి పిప్ ఇన్స్టాల్

play04:24

numpy..

play04:25

అని టైప్ చేయడం ద్వారా నంపీని ఇన్స్టాల్

play04:28

చేయవచ్చు.

play04:29

కాబట్టి, ఈ విధంగా మేము నంపీ లైబ్రరీని

play04:32

లేదా అవసరమైన లైబ్రరీలలో దేనినైనా ఇన్స్టాల్

play04:35

చేసాము నంపీ లైబ్రరీని ఉపయోగించడానికి

play04:38

మీరు ఇప్పటికే దాన్ని ఇన్స్టాల్ చేసి ఉంటారని

play04:42

నేను ఖచ్చితంగా అనుకుంటున్నాను.

play04:43

ఇది . లైబ్రరీని ఎలా ఇన్స్టాల్ చేయాలనే

play04:46

దానిపై ఇది కేవలం ఒక డెమో మాత్రమే,

play04:50

ఎందుకంటే నాకు ఇప్పటికే మెషీన్లో నంపీ ఉంది.

play04:54

అవసరం ఇప్పటికే సంతృప్తి చెందిందని చెప్పారు.

play04:57

కాబట్టి, మనం ఐడిఇకి తిరిగి వెళ్లి దానిపై

play05:00

పనిచేయడం ప్రారంభిద్దాం.

play05:02

కాబట్టి, నేను నంపీ లైబ్రరీని ఎన్పీగా

play05:05

దిగుమతి చేస్తున్నాను.

play05:06

కాబట్టి, np కేవలం నంపీ లైబ్రరీకి విశ్లేషించబడుతుంది.

play05:10

కాబట్టి,

play05:11

నేను ఏదైనా ఫంక్షన్ను ఉపయోగించబోతున్నప్పుడల్లా

play05:13

లేదా డాట్ ఉపయోగించి నంపీ లైబ్రరీ నుండి

play05:16

ఏదైనా ఫంక్షన్ను యాక్సెస్ చేయబోతున్నప్పుడల్లా

play05:19

ఆపరేటర్ అప్పుడు నేను దానిని np గా

play05:22

సూచించబోతున్నాను, నంపీగా కాదు.

play05:24

కాబట్టి, ఒకసారి దిగుమతి చేసుకున్న

play05:27

తర్వాత మీరు కాల్ చేయవచ్చు నంపీ డాట్

play05:30

అర్రే ఫంక్షన్.

play05:32

ప్రాథమికంగా అర్రే అనేది సృష్టించడానికి

play05:34

ఉపయోగించే ఫంక్షన్లలో ఒకటి శ్రేణులు మరియు

play05:37

నంపీ మరియు నేను నంపీ లైబ్రరీ నుండి

play05:41

ఆ ఫంక్షన్ను యాక్సెస్ చేయడానికి డాట్ ఆపరేటర్ను

play05:44

ఉపయోగిస్తున్నాను.

play05:45

నేను దానిని ఎన్పీగా దిగుమతి చేసుకున్నందున

play05:48

నేను ఎన్పీ డాట్ అర్రే మరియు ప్రాథమిక

play05:52

ఎన్ డైమెన్షనల్ అర్రేను మాత్రమే ఉపయోగిస్తున్నాను.

play05:55

ఈ క్రింది విధంగా నంపీలో అర్రే ఫంక్షన్ను

play05:58

ఉపయోగించి సృష్టించబడుతుంది.

play06:00

నేను అర్రే ఫంక్షన్ను ఉపయోగిస్తున్నాను

play06:02

నంపీ లైబ్రరీ నుండి మరియు ప్రతి నంపీ

play06:06

శ్రేణి ఒకే రకమైన మూలకాల గ్రిడ్ కానీ

play06:09

నంపీ శ్రేణులను నిర్మించడానికి మీరు ఉపయోగించగల

play06:12

పెద్ద సంఖ్యలో సంఖ్యా డేటా రకాలను అందిస్తుంది.

play06:16

కాబట్టి, . మీరు శ్రేణిని సృష్టించినప్పుడు

play06:18

డేటా రకాన్ని పొందడానికి నంపీ ప్రయత్నిస్తుంది,

play06:21

కానీ ఫంక్షన్ నిర్మిస్తుంది తొలగించబడిన వాటిలో

play06:24

సాధారణంగా డేటా రకాన్ని స్పష్టంగా పేర్కొనడానికి

play06:28

ఐచ్ఛిక వాదన కూడా ఉంటుంది.

play06:30

కాబట్టి, మీరు ఇక్కడ చూస్తే, అర్రే ఫంక్షన్కు

play06:34

మొదటి వాదన జాబితా ఉన్న నా జాబితా. 1

play06:38

నుండి 6 వరకు విలువలు మరియు తదుపరి వాదన

play06:42

d-రకం అనేది పేర్కొనే పూర్ణాంకాలకు సమానం

play06:45

నేను డేటా రకం పూర్ణాంకంతో ఒక శ్రేణిని సృష్టించబోతున్నాను.

play06:49

మీరు అందించనట్లయితే ఏదైనా, మీరు శ్రేణిని

play06:53

సృష్టించినప్పుడు అది స్వయంచాలకంగా

play06:54

డేటా రకాన్ని అంచనా వేస్తుంది, కానీ

play06:57

ఉంటే మీరు డేటా రకాన్ని స్పష్టంగా పేర్కొనాలనుకుంటున్నారు,

play07:01

అప్పుడు మీరు దీన్ని ఈ విధంగా చేయాలి.

play07:05

కాబట్టి, నేను నంపీ నుండి అర్రే ఫంక్షన్ను

play07:08

ఉపయోగించి అర్రేని సృష్టిస్తున్నాను

play07:10

మరియు నేను కేవలం దానిని ముద్రించండి.

play07:13

కాబట్టి, అర్రే ఇప్పుడు సృష్టించబడింది.

play07:16

కాబట్టి, ఇప్పుడు నేను శ్రేణి రకాన్ని

play07:19

ముద్రిస్తున్నాను.

play07:20

కాబట్టి, ఇది ప్రాథమికంగా మీకు డేటాను అందిస్తుంది

play07:23

మీరు అవుట్పుట్ను ప్రింట్ చేస్తే వస్తువు

play07:26

యొక్క రకం క్లాస్ నంపీ డాట్ nd అర్రే

play07:30

ఎందుకంటే నంపీ యొక్క ప్రధాన శ్రేణి వస్తువు

play07:34

సజాతీయ బహుళ-డైమెన్షనల్ శ్రేణి, ఇది మీకు

play07:37

శ్రేణి రకాన్ని ఇస్తుంది

play07:39

మీ శ్రేణి యొక్క కొలతలతో సంబంధం లేకుండా

play07:42

numpy డాట్ nd శ్రేణి.

play07:45

తదుపరి విషయం ఇది లెన్ ఆఫ్ అర్రే, ఇది

play07:49

మీకు శ్రేణిలోని మొత్తం మూలకాల సంఖ్యను

play07:52

ఇవ్వబోతోంది.

play07:53

కాబట్టి, శ్రేణిలోని మూలకాల మొత్తం సంఖ్య

play07:56

6 మరియు మీరు అక్షం యొక్క సంఖ్యను కూడా

play08:00

పొందవచ్చు.

play08:01

శ్రేణి యొక్క కొలతల సంఖ్యను సూచించే

play08:04

ఎన్డిమ్ను ఇవ్వడం ద్వారా శ్రేణి ఒకటి

play08:07

అని చెబుతుంది ఎందుకంటే మీకు దీనికి ఒకే

play08:10

ఒక కోణం ఉంది, అంటే మీ శ్రేణికి మీకు

play08:15

ఒకే ఒక ప్రాప్యత మాత్రమే ఉందని అర్థం.

play08:18

కాబట్టి,

play08:19

ఇప్పుడు నేను అర్రె.

play08:21

యొక్క పరిమాణాన్ని తనిఖీ చేస్తాను;

play08:23

కాబట్టి, శ్రేణి యొక్క పరిమాణం ఇవ్వబోతోంది

play08:26

మీరు ప్రతి పరిమాణంలో శ్రేణి పరిమాణాన్ని

play08:29

సూచించే పూర్ణాంకాల టుపుల్ యొక్క అవుట్పుట్.

play08:32

మేము శ్రేణి యొక్క పరిమాణం 1 అని తెలుసుకోండి

play08:37

మరియు ప్రతి పరిమాణం వెంట పరిమాణాన్ని

play08:40

తనిఖీ చేద్దాం.

play08:41

కాబట్టి, మీరు శ్రేణిని సృష్టించినప్పుడు

play08:43

స్వయంచాలకంగా మీకు వెక్టర్ ఉంటుంది.

play08:46

కాబట్టి, ; మీకు 1 నిలువు వరుసతో 6 వరుసలు ఉంటాయి,

play08:51

అక్కడ మీకు 6 ఉన్నాయి, ఏమీ లేదు.

play08:54

కానీ

play08:55

శ్రేణి యొక్క ఆకారాన్ని వివిధ ఆదేశాలతో మార్చవచ్చు.

play08:59

నేను అనే ఆదేశాన్ని ఉపయోగించబోతున్నాను.

play09:01

మీ శ్రేణిని పునఃరూపకల్పన చేయడానికి ఉపయోగించబోయే

play09:04

పునఃరూపకల్పన, కానీ ఈ క్రింది ఆదేశం

play09:07

మీకు తెలుసు మీ సవరించిన శ్రేణిని మాత్రమే

play09:11

తిరిగి ఇస్తుంది కానీ అది అసలు శ్రేణిని

play09:14

అస్సలు మార్చదు.

play09:16

కాబట్టి, రీషేప్ ఫంక్షన్ను ఎలా ఉపయోగించవచ్చో

play09:19

చూద్దాం.

play09:20

కాబట్టి, 3, 2 అనేది 3 వరుసలతో మరియు 2

play09:24

నిలువు వరుసలతో నిలువు వరుసను పునఃరూపకల్పన

play09:27

చేయబోతున్నప్పటికీ సూచిస్తుంది.

play09:28

కాబట్టి,

play09:29

నేను 3 వరుసలు మరియు 2 నిలువు వరుసలను

play09:33

కలిగి ఉన్న శ్రేణిని పునర్నిర్మించాను.

play09:36

ఇప్పుడు మరియు దానిని పునఃరూపకల్పన చేసిన

play09:39

తర్వాత మీరు తనిఖీ చేస్తే శ్రేణి యొక్క

play09:42

ఆకారం మీకు ఇవ్వబోతోంది; అవుట్పుట్ 3,2 గా మేము

play09:47

శ్రేణిని పునఃరూపకల్పన చేసాము పరిమాణం 3,2

play09:50

విషయానికొస్తే.

play09:51

కానీ ఒక పరిమాణం పునఃరూపకల్పన ఆపరేషన్లో

play09:53

మైనస్ 1 గా ఇవ్వబడితే నేను ఇచ్చిన ఉదాహరణ

play09:58

వలె, ఇతర కొలతలు స్వయంచాలకంగా లెక్కించబడతాయి.

play10:01

ఎందుకంటే 3 మొదటి వాదన 3 దానిలో ఎన్ని

play10:05

సంఖ్యలు ఉండాలి మరియు మైనస్ ఒకటి ఎలా ఉండాలి

play10:09

అని సూచిస్తుంది.

play10:10

ఇతర కోణాన్ని సూచిస్తుంది, ఇది నంపీ లైబ్రరీ

play10:14

ద్వారా స్వయంచాలకంగా లెక్కించబడుతుంది

play10:16

ఎందుకంటే శ్రేణులు ఎలా సృష్టించబడతాయో

play10:18

మరియు మనం ఎలా చేయగలమో వివరించడానికి ఇది

play10:22

కేవలం ఒక బొమ్మ ఉదాహరణ మాత్రమే.

play10:25

శ్రేణులపై కొన్ని కార్యకలాపాలను నిర్వహించండి.

play10:27

కానీ మీరు పెద్ద శ్రేణి శ్రేణితో

play10:31

వ్యవహరిస్తుంటే, అప్పుడు ఆ సందర్భంలో

play10:33

మీ శ్రేణి యొక్క కొలతల గురించి మీకు

play10:37

ఖచ్చితంగా తెలియదు, అప్పుడు మీరు కేవలం

play10:40

ఆకృతిని మార్చాలనుకుంటే ఇది మీకు కావలసిన

play10:43

పరిమాణం ప్రకారం, అప్పుడు మీరు మైనస్

play10:46

1ని ఏదైనా పరిమాణంగా ఉపయోగించవచ్చు.

play10:48

ఎందుకంటే పునఃరూపకల్పనను ఉపయోగించడానికి

play10:50

కనీసం మీరు ఒక కోణాన్ని ఖచ్చితంగా పేర్కొనాలి.

play10:54

మీరు మైనస్ 1 ని పరిష్కరించిన తర్వాత ఇతర పరిమాణాన్ని

play10:59

స్వయంచాలకంగా నంపీ శ్రేణి ద్వారా లెక్కించవచ్చు.

play11:02

కాబట్టి, ఇక్కడ నేను నిలువు వరుస కొలత

play11:05

వెంట మైనస్ 1 ని స్థిరపరచండి.

play11:08

కాబట్టి, మీకు 3 వరుసలు మరియు 2 నిలువు వరుసలు

play11:13

ఉంటాయి.

play11:14

అప్పుడు మీ శ్రేణి పరిమాణం ప్రకారం

play11:17

లెక్కించబడుతుంది.

play11:18

కాబట్టి, ప్రాథమికంగా ఇది సంఖ్యపై ఆధారపడి

play11:20

ఉంటుంది నేను 6 విలువలను కలిగి ఉన్నందున శ్రేణిలో

play11:25

ఉండే మూలకాలను నేను 3 గా ఇచ్చాను.

play11:28

కాబట్టి, ఇది 3,2 గా పునఃరూపకల్పన చేయబోతోంది.

play11:32

కాబట్టి, దానిలో ఉన్నది అదే కానీ

play11:35

ఇప్పుడు మీరు తనిఖీ చేస్తే ఎన్డిమ్ ఉపయోగించి

play11:39

మీ శ్రేణి యొక్క పరిమాణం అని చెబుతుంది

play11:42

ఎందుకంటే మీరు కు ప్రాప్యత కలిగి ఉండాలి

play11:46

శ్రేణి ఇప్పుడు ఒక వరుస మరియు ఏకత్వం

play11:50

column.

play11:51

తెలుసు; కాబట్టి, శ్రేణి యొక్క పరిమాణం

play11:53

2.

play11:54

కాబట్టి మనము నెస్టెడ్ పైథాన్ జాబితాల నుండి

play11:58

కూడా నంపీ శ్రేణులను ప్రారంభించవచ్చు.

play12:00

కాబట్టి, మొదట్లో మాకు కేవలం సంఖ్య

play12:03

శ్రేణికి వాదనగా ఒక జాబితా మాత్రమే

play12:06

ఉండేది.

play12:07

కానీ ఇక్కడ నేను అంపైర్ శ్రేణిని

play12:10

సృష్టించబోతున్నాను

play12:11

నేస్టెడ్ పైథాన్ జాబితా నుండి నేను

play12:13

కొన్ని సంఖ్యలను కలిగి ఉన్న మూడు

play12:17

సెట్ల జాబితాలను సృష్టించాను.

play12:18

కాబట్టి, నా దగ్గర మూడు జాబితాలు ఉన్నాయి,

play12:22

నా జాబితా 2 నా జాబితా 3 నా జాబితా 4 నేను

play12:28

నంపీ నుండి అర్రే ఫంక్షన్ను ఉపయోగిస్తున్నాను.

play12:31

లైబ్రరీ మరియు దాని లోపల నేను ఆమోదించాల్సిన

play12:35

అంశాలుగా జాబితాల జాబితాలను ఇవ్వబోతున్నాను

play12:37

ఒక వాదనగా.

play12:38

కాబట్టి, మీరు ఇక్కడ చూడగలిగితే నా జాబితా

play12:42

కూడా ఒక జాబితా మరియు నేను మూడు ఇచ్చాను.

play12:46

జాబితాలు మరియు దాని వెలుపల చదరపు బ్రాకెట్లు

play12:50

ఇవ్వబడ్డాయి మరియు జాబితా లోపల కూడా

play12:53

నాకు మూడు ఉన్నాయి

play12:55

దానిని జాబితా చేయండి.

play12:57

కాబట్టి, మీరు దానిని ప్రింట్ చేస్తే,

play13:00

అది మీకు ఇలాంటి అవుట్పుట్ను ఇవ్వబోతోంది.

play13:03

కాబట్టి, మీరు ముల్ అండర్స్కోర్ అర్ర్

play13:06

అనే శ్రేణిని సృష్టించారు, దీనికి కొన్ని విలువలు

play13:09

ఉన్నాయి.

play13:10

ఇప్పుడు మీరు దాని ఆకారాన్ని తనిఖీ

play13:13

చేస్తే, అది మనకు 3ని ఇచ్చే పరిమాణాన్ని

play13:17

తనిఖీ చేయండి. 5 ఎందుకంటే ఇది 5 నిలువు వరుసలతో

play13:22

3 వరుసలను కలిగి ఉంటుంది.

play13:24

మరియు మీరు మీ బహుళ-డైమెన్షనల్ రూపాన్ని పునర్నిర్మించగలగాలి.

play13:28

శ్రేణిని అలాగే పునఃరూపకల్పన ఫంక్షన్ను ఉపయోగిస్తున్నాను

play13:31

మరియు నేను బహు-డైమెన్షనల్ శ్రేణిని 1 గా పునర్నిర్మిస్తున్నాను,

play13:35

15.

play13:36

కాబట్టి, నేను 15 వేర్వేరు నిలువు వరుసలతో ఒకే

play13:40

వరుసలో శ్రేణి విలువలను కలిగి ఉండగలను ఆపై

play13:44

మేము మీ నంపీ నుండి మీరు పొందగలిగే కొన్ని

play13:48

లక్షణాలను చూడబోతున్నాము.

play13:49

కాబట్టి నేను ఇప్పుడే a అనే శ్రేణిని సృష్టించాను,

play13:52

దీనికి రెండు జాబితాలు ఉన్నాయి.

play13:55

కాబట్టి, దీనికి రెండు వరుసలు ఉన్నాయి

play13:57

మరియు శ్రేణి యొక్క ఆకారంలో ఉన్న మూడు

play14:00

నిలువు వరుసల ఆకారం లక్షణాలలో ఒకటి.

play14:03

నేను మీకు చెప్పినట్లుగా అనేక మార్గాలు ఉన్నాయి

play14:06

లేదా ఎర్రే.

play14:07

ను పునఃరూపకల్పన చేయడానికి ఉపయోగించే

play14:09

అనేక ఆదేశాలు ఉన్నాయి.

play14:11

కానీ రీషేప్ ఫంక్షన్ను ఉపయోగించి అర్రేను

play14:13

ఎలా రీషేప్ చేయాలో నేను మీకు ఒక ఉదాహరణ

play14:17

ఇచ్చాను.

play14:18

ఇక్కడ మీరు n డైమెన్షనల్ శ్రేణిని పునఃరూపకల్పన

play14:20

చేయడానికి ఉపయోగించగల మరొక పద్ధతి ఉంది

play14:21

ఎందుకంటే a డాట్ ఆకారం ప్రాథమికంగా మీకు

play14:23

శ్రేణి యొక్క పరిమాణాన్ని ఇస్తుంది మరియు నేను

play14:24

కేవలం ఒక టుపుల్ను పాస్ చేస్తున్నాను

play14:26

ఇది కొంత పూర్ణాంకాన్ని కలిగి ఉంటుంది మరియు

play14:27

ఇది శ్రేణి యొక్క పరిమాణాన్ని కూడా

play14:29

వివరిస్తుంది ఇన్పుట్ చేయండి.

play14:30

నేను నా శ్రేణిని పరిమాణం 3,2 తో పునర్నిర్మించాను.

play14:31

కాబట్టి, ఇప్పుడు పునఃరూపకల్పన శ్రేణి

play14:32

ఇక్కడ ఇవ్వబడింది మరియు రీషేప్ ఫంక్షన్ను

play14:33

ఉపయోగించి అర్రేను ఎలా రీషేప్ చేయాలో

play14:35

కూడా నేను ప్రస్తావించాను.

play14:36

మీరు విలువల క్రమాన్ని కూడా సృష్టించగలుగుతారు,

play14:37

ఆపై విలువలను ఉపయోగించి శ్రేణిగా సృష్టించబడతారు.

play14:38

పరిధి ఫంక్షన్.

play14:39

కాబట్టి, నేను 24 యొక్క పరిధిని ఇచ్చాను.

play14:40

కాబట్టి, ఇది నాకు ఒక క్రమాన్ని ఇవ్వబోతోంది

play14:42

విలువలు 0 నుండి 24 వరకు రేంజ్‌ గా ప్రారంభమవుతాయి;

play14:44

కానీ శ్రేణి ఫంక్షన్ను ఉపయోగించడంలో ఇబ్బంది

play14:45

ఉంది సృష్టించిన పరిధిలో ఉన్న విలువలు

play14:46

ఏమిటో మీరు చూడలేదా?

play14:47

మీరు r ని ప్రింట్ చేసినప్పుడు అది

play14:49

0 కామా 24 పరిధిని అవుట్పుట్గా తిరిగి ఇవ్వబోతోంది.

play14:51

కాబట్టి, మీరు నియంత్రణ నిర్మాణాలతో వ్యవహరిస్తున్నప్పుడు

play14:52

శ్రేణి ఫంక్షన్ తరచుగా ఉపయోగించబడుతుంది.

play14:53

మీరు ఇచ్చిన విలువల క్రమాన్ని ఉపయోగించి

play14:54

విలువను పునరావృతం చేయాలనుకుంటే ఆ కేసు

play14:56

పరిధిలో పరిధి చాలా సహాయకరంగా ఉంటుంది.

play14:57

కానీ ఒక క్రమాన్ని సృష్టించడానికి

play14:58

విలువలు మనం నంపీ లైబ్రరీ నుండి అమర్చబడిన

play14:59

అనే ఫంక్షన్ను ఉపయోగించవచ్చు.

play15:00

దీనిని రేజ్ అని పిలుస్తారు ఎందుకంటే

play15:02

నంపీ నుండి ఇది సీక్వెన్స్ ఆధారంగా ఒక శ్రేణిని

play15:03

సృష్టించబోతోంది మీరు ఇన్పుట్గా ఇచ్చిన

play15:04

విలువలు కానీ అది ఒక శ్రేణిని తిరిగి

play15:06

ఇవ్వబోతోంది ఫంక్షన్ పేరు ఎందుకు రేంజ్‌

play15:07

కాబట్టి, అరేంజ్ ఫంక్షన్ ప్రారంభ

play15:08

వాక్యనిర్మాణం విలువ స్టాప్ విలువ మరియు

play15:10

తరువాత ఇంక్రిమెంటల్ వాల్యూ కాబట్టి,

play15:11

ఇది ప్రాథమికంగా మూడు వాదనలను తీసుకుంటుంది

play15:12

కేవలం ఒక వాదన మాత్రమే ఇచ్చారు.

play15:13

కాబట్టి, డిఫాల్ట్గా అది ఆ విలువను 'అని

play15:15

తీసుకోబోతోంది.

play15:16

ఒక స్టాప్ విలువ మరియు మీకు ఎటువంటి

play15:17

ప్రారంభ విలువ ఇవ్వకపోతే అది సున్నా నుండి

play15:18

ప్రారంభమవుతుంది.

play15:19

మరియు డిఫాల్ట్గా ఇది విలువను పెంచబోతోంది,

play15:20

కానీ నేను ఇక్కడ 24ని ఇచ్చాను కానీ

play15:21

మొదటిది.

play15:22

నేను ఇచ్చిన స్టాక్ విలువను వివరించే

play15:23

23 వరకు మీకు ఉండేది.

play15:24

ఇక్కడ అది ఒక చిన్న n మైనస్ 1 ని తిరిగి

play15:27

ఇస్తుంది; కాబట్టి, మీరు 24 ఇచ్చినట్లయితే

play15:29

అది తిరిగి వస్తుంది 23.

play15:31

మీరు ఇప్పుడు సృష్టించిన మీ శ్రేణి యొక్క

play15:34

పరిమాణాన్ని తనిఖీ చేస్తే అది 1 మాత్రమే.

play15:36

కాబట్టి, మీరు ఇక్కడ చూడగలిగితే ఇది అసలు

play15:39

శ్రేణి, నేను ఇచ్చిన శ్రేణిని చుట్టేస్తున్నాను.

play15:41

6 మొదటి వాదనగా ఇది అన్ని విలువలను 6

play15:45

వాహకాలుగా మరియు ప్రతి వాహకంగా ఉంచబోతోంది.

play15:47

ప్రతి వెక్టర్ కింద పరిమాణం 4,1 ఉంటుంది,

play15:49

మీకు నాలుగు వరుసలలో విలువలు ఉంటాయి.

play15:52

0 నుండి 3 వరకు ఉన్న ఒకే నిలువు వరుస

play15:55

ఒక వెక్టర్ మరియు ఇది కలిగి ఉంది మరియు

play15:58

దీనికి 4 క్రాస్ 1 పరిమాణం ఉంది మరియు

play16:02

రెండవ వెక్టర్ కూడా ఇతర వెక్టర్ల మాదిరిగానే

play16:04

ఒకే నిలువు వరుసలో 4 విలువలను కలిగి

play16:07

ఉంటుంది.

play16:08

కాబట్టి, నేను మొదటి డైమెన్షన్ ను అది

play16:10

కలిగి ఉండాల్సిన వెక్టర్ల సంఖ్యగా

play16:12

ఇచ్చాను.

play16:13

ప్రతి వెక్టర్ క్రింద 4,1 పరిమాణం ఎంత, ఇది

play16:16

సంఖ్యను సూచిస్తుంది శ్రేణిని పునఃరూపకల్పన

play16:17

చేయడానికి మీరు ఉపయోగించబోయే వరుసలు మరియు నిలువు

play16:20

వరుసల సంఖ్య.

play16:21

కాబట్టి, ఈ విధంగా మనం రీషేప్ ఫంక్షన్ను

play16:24

ఉపయోగించి అర్రేను రీషేప్ చేయవచ్చు.

play16:26

మరియు మీరు నంపీ శ్రేణులపై కొన్ని

play16:28

అంకగణిత కార్యకలాపాలను కూడా నిర్వహించవచ్చు.

play16:30

కాబట్టి,

play16:31

నేను రెండు శ్రేణులను సృష్టించాను.

play16:32

కాబట్టి, x మరియు y శ్రేణుల లోపల ఉన్న

play16:35

మూలకాలు ఫ్లోట్ 64 మరియు.

play16:37

మీరు జోడింపు, వ్యవకలనం వంటి కొన్ని అంకగణిత

play16:40

కార్యకలాపాలను నిర్వహించవచ్చు.

play16:41

మీరు సృష్టించిన శ్రేణులపై గుణకారం,

play16:43

విభజన మరియు మొదలైనవి.

play16:44

కాబట్టి, ఒక్కొక్కదానిపై ఒక ఉదాహరణ ద్వారా

play16:47

మిమ్మల్ని తీసుకెళ్తాను.

play16:48

కాబట్టి, మొదట మనం యాడ్ ని చూడబోతున్నాం.

play16:51

కాబట్టి, నంపీ డాట్ రెండు శ్రేణుల మధ్య

play16:54

మూలకం తెలివైన చేరికను ప్రదర్శిస్తుంది.

play16:56

మరియు వాక్యనిర్మాణం ఏమిటంటే మీరు 'యాడ్

play16:59

ఫంక్షన్' ను ఉపయోగించవచ్చు మరియు ఫంక్షన్ లోపల

play17:02

మీరు 'యాడ్ ఫంక్షన్' ను ఉపయోగించవచ్చు.

play17:04

జోడించడానికి ఉపయోగించబడే తుడిచివేయడానికి

play17:06

పేర్కొనవచ్చు మరియు మీరు అలా చేయవచ్చు

play17:08

లేదా మీరు ప్లస్ ఆపరేటర్ను ఉపయోగించి

play17:11

మూలకం వారీగా అదనంగా చేయవచ్చు.

play17:13

కాబట్టి, నేను ప్లస్ ఆపరేటర్ మరియు యాడ్

play17:16

ఫంక్షన్ రెండింటినీ ఉపయోగించి అదనంగా

play17:18

వివరిస్తున్నాను.

play17:19

కాబట్టి, & nbsp; & nbsp; నేను ఇంతకు ముందు చెప్పినట్లుగా

play17:22

ఇది మూలకం వారీగా అదనంగా చేయబోతోంది.

play17:25

కాబట్టి, శ్రేణి a యొక్క మొదటి మూలకం

play17:27

ఒకటి.

play17:28

కాబట్టి, మొదటి మూలకం శ్రేణి x అనేది ఒకటి

play17:29

మరియు శ్రేణి y యొక్క మొదటి మూలకం, ఇది

play17:30

ప్రధానమైనది ఒకటి ప్లస్ ఐదు జోడించబడతాయి

play17:31

6.

play17:32

కాబట్టి, అది మీరు చూస్తున్న అవుట్పుట్.

play17:33

ఇక్కడ.

play17:34

కాబట్టి అదేవిధంగా ఇది మూలకాన్ని తెలివిగా

play17:35

జోడిస్తుంది మరియు అన్ని సందర్భాల్లో

play17:36

మరియు మీరు వన్ ప్లస్ టూ ఆపరేటర్ కోసం

play17:37

అవుట్పుట్ చేయాలి మరియు ఒకదానికి ఎన్పీ

play17:38

డాట్ యాడ్ ఫంక్షన్ను ఉపయోగించాలి.

play17:39

అదేవిధంగా మీరు రెండు శ్రేణుల మధ్య మూలకం

play17:40

వారీగా వ్యవకలనం చేయవచ్చు నంపీ నుండి

play17:41

ఫంక్షన్ను తీసివేయండి మరియు వాక్యనిర్మాణం

play17:42

అలాగే ఉంటుంది మరియు మీరు దానిని భర్తీ

play17:43

చేయాలి మైనస్ మరియు వ్యవకలనం ఫంక్షన్తో

play17:44

అదే కమాండ్ మరియు ఇది మూలకాన్ని చేస్తుంది

play17:45

తెలివైన వ్యవకలనం మరియు మీరు రెండు

play17:46

మధ్య మూలకం వారీగా గుణకారం చేయవచ్చు

play17:47

శ్రేణులు మరియు ఆస్ట్రప్ను ఉపయోగించి మీరు రెండు

play17:48

శ్రేణుల మధ్య మూలకం వారీగా గుణించగలుగుతారు.

play17:49

కానీ మీరు రెండు శ్రేణుల యొక్క డాట్

play17:50

ఉత్పత్తిని పొందాలనుకుంటే, మీరు ఫంక్షన్ను ఉపయోగించవచ్చు

play17:51

y యొక్క డాట్ x డాట్ అని పిలవబడేది మీకు

play17:52

రెండు శ్రేణుల యొక్క డాట్ ఉత్పత్తిని

play17:53

ఇవ్వబోతోంది మరియు y మరియు మీరు డాట్

play17:54

ఫంక్షన్ను ఒక శ్రేణిలో వర్తింపజేయడం ద్వారా

play17:55

ఉపయోగించవచ్చు మరియు అప్పుడు దానిని ఇతర

play17:56

శ్రేణిలో ఉపయోగించండి లేదా మీరు ఫంక్షన్

play17:57

లోపల ఎన్పి డాట్ డాట్ను ఉపయోగించవచ్చు.

play17:58

మీరు గుణించాల్సిన కావలసిన రెండు తొలగింపులను

play17:59

మాత్రమే ఇవ్వవచ్చు.

play18:00

అదేవిధంగా మీరు x అనే రెండు శ్రేణుల

play18:01

మధ్య విభజనను కూడా చేయవచ్చు.

play18:02

మరియు y స్లాష్ ఆపరేటర్ను ఉపయోగించడం ద్వారా

play18:03

లేదా నంపీ లైబ్రరీ నుండి విభజన ఫంక్షన్ను

play18:04

ఉపయోగించడం ద్వారా.

play18:05

కాబట్టి, అన్ని అదనంగా వ్యవకలనం గుణకారం

play18:06

మరియు విభజన ; అవసరమైన ఆదేశాలు రెండు శ్రేణుల

play18:07

మధ్య మూలకం వారీగా ఆపరేషన్ చేయబోతున్నాయి.

play18:08

శ్రేణులపై ఇతర ఫంక్షన్లను మీరు ఎలా ఉపయోగించవచ్చనే

play18:09

దానిపై నేను ఒక స్నిప్పెట్ ఇచ్చాను.

play18:10

నేను ఇచ్చాను

play18:11

మొదటి నిలువు వరుసలో ఫంక్షన్ పేరు మరియు

play18:12

నేను దానితో పాటు డిస్క్రిప్షన్ను

play18:13

కూడా జోడిస్తాను మరియు మీరు నంపీ

play18:14

శ్రేణులపై మనం చేయగల మరిన్ని ఫంక్షన్లను

play18:15

అన్వేషించడానికి ప్రాథమికంగా దీనిని

play18:16

సూచించవచ్చు.

play18:17

అప్పుడు మనము నంపీ ఎరేస్ మీద కొన్ని

play18:18

ఆపరేషన్లు చేయబోతున్నాము, మొదటి విషయం మొత్తం.

play18:19

కాబట్టి, నంపీ లైబ్రరీ నుండి డాట్ మొత్తాన్ని

play18:20

ఉపయోగించడం ద్వారా అన్ని శ్రేణి మూలకాల

play18:21

మొత్తం లేదా అన్ని శ్రేణి మొత్తాన్ని

play18:22

అందిస్తుంది ఇచ్చిన అక్షం మీద మూలకాలు.

play18:23

కాబట్టి, వాక్యనిర్మాణం నంపీ డాట్ సమ్ మరియు

play18:24

మొదటి వాదన నంపీ డాట్ సమ్.

play18:25

ఉపయోగించబోయే అర్రే కావలసిన అర్రే.

play18:26

తదుపరిది అక్షం.

play18:27

కాబట్టి, మనం ఎలా ఉపయోగించవచ్చో చూద్దాం.

play18:28

ఈ ఫంక్షన్.

play18:29

కాబట్టి, నేను కేవలం np డాట్ ని ప్రింట్

play18:30

చేస్తున్నాను, మీరు ఇక్కడ చూడగలిగితే

play18:31

నేను x ని యాక్సెస్ చేస్తున్నాను.

play18:32

నంపీ లైబ్రరీ నుండి ఫంక్షన్ మొత్తం మరియు

play18:33

ఫంక్షన్ లోపల నేను ఒకే ఒక వాదనను మాత్రమే

play18:34

ఇచ్చాను అది x, ఇది మనం ఇప్పటికే సృష్టించిన

play18:35

శ్రేణి మరియు నేను ఎటువంటి యాక్సెస్

play18:36

విలువను ఇవ్వలేదు.

play18:37

కాబట్టి, అప్రమేయంగా అక్షం ఏదీ కాదు.

play18:38

కాబట్టి, ఇది కేవలం శ్రేణి యొక్క మొత్తం

play18:39

మొత్తాన్ని లెక్కించబోతోంది.

play18:40

x.

play18:41

కాబట్టి, ప్రింటర్ x యొక్క అవుట్పుట్.

play18:42

కాబట్టి, ఇది శ్రేణి x లో ఉన్నది మరియు

play18:43

np ని ఉపయోగించడం ద్వారా.

play18:44

ఇది శ్రేణి x1 ప్లస్ 2 ప్లస్ 3 ప్లస్ 4 యొక్క

play18:45

మొత్తం మొత్తాన్ని లెక్కిస్తుంది, కానీ

play18:46

మీరు అయితే యాక్సెస్ ఆర్గ్యుమెంట్ లో

play18:47

విలువను అందిస్తున్నారు, అప్పుడు అది తదనుగుణంగా

play18:48

పని చేయబోతోంది.

play18:49

కాబట్టి, అక్షం విలువలు 0 లేదా 1 కావచ్చు; కాబట్టి,

play18:50

సున్నా ప్రదర్శించడాన్ని సూచిస్తుంది వరుసలపై

play18:51

ఆపరేషన్ మరియు 1 నిలువు వరుసలపై ఆపరేషన్లను

play18:52

సూచిస్తుంది.

play18:53

ఉదాహరణకు ఇది శ్రేణి x లోని ప్రతి నిలువు

play18:54

వరుస మొత్తాన్ని లెక్కిస్తుంది, ఉదాహరణకు

play18:55

నేను యాక్సెస్ ఇచ్చాను 0 కి సమానం, అప్పుడు

play18:56

అది మొదటి వరుస నుండి విలువను తీసుకుంటుంది,

play18:57

ఆపై రెండవ వరుస నుండి విలువను తీసుకుంటుంది.

play18:58

ఇది వరుసలను దాటబోతున్నప్పటికీ, ఇది మీకు ప్రతి నిలువు

play18:59

వరుస మొత్తాన్ని ఇవ్వబోతోంది.

play19:00

కాబట్టి, & nbsp; & nbsp; మీరు చూస్తే 1 ప్లస్ 3 మీకు

play19:01

4 మరియు 2 ప్లస్ 4 ప్లస్ 6 ఇస్తుంది.

play19:02

కాబట్టి, మీరు అక్షం ఇస్తే అది ప్రాథమికంగా

play19:03

ఉంటుంది 0కి సమానం, ఇది ప్రతి నిలువు

play19:04

వరుస మొత్తాన్ని లెక్కిస్తుంది మరియు

play19:06

ప్రాప్యత ఇవ్వడం ద్వారా 1కి సమానం,

play19:09

ఇది లెక్కిస్తుంది

play19:10

ప్రతి వరుస యొక్క మొత్తం.

play19:13

కాబట్టి, ప్రతి వరుస మొత్తం తరువాత నిలువు

play19:16

వరుసలను దాటడం ద్వారా ఉంటుంది అంటే మనం

play19:20

1 + 2 = 3 మరియు 3 + 4 = 7 అని ఇచ్చాము.

play19:26

కాబట్టి, అదేవిధంగా మీరు మీన్ మీడియన్

play19:29

వంటి ఫంక్షన్లలో నిర్మించిన ఏదైనా

play19:31

నమూనాను ఉపయోగించగలుగుతారు.

play19:32

మొత్తానికి బదులుగా మీరు దానిపై మరింత

play19:35

అన్వేషించవచ్చు మరియు మీరు మరొకటి

play19:37

కూడా చేయగలుగుతారు.

play19:39

మీరు ఇప్పటికే సంఖ్య శ్రేణిలో కూడా సృష్టించిన

play19:42

విధులు.

play19:43

ఈ ఉపన్యాసంలో మనం

play19:44

అంతర్నిర్మిత పైథాన్ శ్రేణులపై నంపీ శ్రేణులను

play19:47

ఉపయోగించడం వల్ల కలిగే ప్రయోజనం ఏమిటో

play19:50

చూశారా?

play19:51

మరియు రాబోయే ఉపన్యాసాలలో ఈ సంఖ్య శ్రేణులను

play19:54

ప్రదర్శించడానికి ఎలా ఉపయోగించవచ్చో

play19:56

చూద్దాం.

play19:57

బహుళ-డైమెన్షనల్ డేటాపై గణిత మరియు

play19:59

తార్కిక కార్యకలాపాలు, ధన్యవాదాలు.

Rate This

5.0 / 5 (0 votes)

Связанные теги
NumPy TutorialPython LibraryNumerical ComputingData ProcessingMultidimensional ArraysPython ProgrammingCoding TutorialTechnical ContentEducational VideoArray Functions
Вам нужно краткое изложение на английском?