Introduction to Spyder - Part 2
Summary
TLDRThe video script provides a comprehensive tutorial on executing Python scripts and debugging techniques. It covers running entire files or specific sections of code using the 'Run File' and 'Run Selection' commands, as well as how to interpret the output. The script also discusses adding comments for code development, clearing the console and environment variables using commands like '%clear' and '%reset', and accessing Python's built-in libraries like NumPy for data science tasks. The tutorial is designed to help users understand the basics of script execution, debugging, and environment management in Python.
Takeaways
- 😀 The script introduces the process of executing Python files and applying certain sections of code using the 'Run' option.
- 🔍 It explains how to add comments and explanations to code snippets to facilitate understanding and debugging.
- 📂 The script covers how to reset the environment by clearing the console and the environment variables using specific commands.
- 🔑 The use of the F5 and F9 keyboard shortcuts is highlighted for executing entire files and selected sections of code, respectively.
- 💡 The importance of comments in code is emphasized for better readability and for developers to understand the purpose and functionality of the code.
- 🛠️ Debugging techniques such as using 'Run Selection' or pressing F9 are discussed to execute specific parts of the code and observe the output.
- 🗑️ The script demonstrates methods to clear the console and environment variables, either individually or all at once, using commands like '%clear' and '%reset'.
- 📝 The transcript mentions the use of 'Variable Explorer' to check the values of variables after code execution.
- 📚 An overview of essential Python libraries such as NumPy, pandas, Matplotlib, and scikit-learn is provided, which are fundamental for data science tasks.
- 🔄 The process of accessing and utilizing sub-libraries within the main libraries using the 'help' function and search box is explained.
- 🔍️ The script concludes with a summary of how to apply, comment, clear, and access basic libraries in Python for effective coding and debugging.
Q & A
What is the main topic of the provided script?
-The main topic of the script is about running Python scripts, executing specific sections of code, using comments for code explanation, and clearing the console and environment in Python.
How can one execute an entire Python file at once according to the script?
-One can execute an entire Python file at once by using the 'Run File' option, which is equivalent to pressing F5 from the keyboard.
What keyboard shortcut is used to execute a selected section of code?
-The keyboard shortcut to execute a selected section of code is F9, or Control+Enter when a line is highlighted.
How can one view the values of variables after running the code?
-One can view the values of variables in the 'Variable Explorer' after running the code.
What is the purpose of adding comments to the code?
-Adding comments to the code helps in understanding the purpose of the code and its development process, which is useful for others reviewing the code or for revisiting it in the future.
How can one clear the console output after running the code?
-One can clear the console output by typing '%clear' in the console and pressing Enter.
What is the command to reset the entire environment in Python?
-The command to reset the entire environment in Python is '%reset', which clears all variables and brings you back to a fresh prompt.
How can one access the documentation of a specific library in Python?
-One can access the documentation of a specific library by typing the library name in the search box of the help tab or by using the 'help()' function followed by the library name.
What are the four main libraries installed with Python for data science?
-The four main libraries installed with Python for data science are NumPy, pandas, Matplotlib, and scikit-learn.
How can one check the content of a library's directory?
-One can check the content of a library's directory by saving the entire directory content to a variable and then printing that variable.
What is the use of the '%reset' command with the 'confirm' option?
-The '%reset -f' command is used to forcefully reset the environment without confirmation, which is helpful when you want to clear all variables without being prompted for confirmation.
Outlines
🐍 Introduction to Running Python Scripts
This paragraph introduces the topic of running Python scripts and how to execute them using the 'Run File' option in an IDE. It discusses the process of running entire scripts, selecting specific parts of code to run, and how to clear the console. The speaker also explains how to use comments to add explanations to the code, which is beneficial for understanding the purpose and functionality of the code blocks. The paragraph ends with a demonstration of running a script that prints values of variables 'a' and 'b', and how to observe the output in the console and variable explorer.
🛠 Debugging with Run Selection and Code Execution
The second paragraph delves into the use of the 'Run Selection' feature for debugging purposes. It explains how to execute specific sections of code by selecting them and using the 'Run Selection' command or the F9 keyboard shortcut. The speaker illustrates the process with an example, changing the value of variable 'a' and observing the output in the console. The paragraph also covers how to step through the code line by line and execute individual lines to understand their effects. Additionally, it touches on the challenges of using 'Run Selection' with large codebases and suggests using comments to isolate and test specific parts of the code.
🗑️ Clearing the Console and Environment Variables
The final paragraph focuses on how to clear the console and the environment after running Python scripts. It starts with a demonstration of clearing the console output using the '%clear' command and discusses the difference between clearing the console and resetting the environment. The speaker then explains how to delete individual environment variables using the 'del' command and how to clear all variables at once using the '%reset' command. The paragraph also mentions the use of the Variable Explorer to confirm the deletion of variables and the caution required when resetting the environment to avoid losing important data. Lastly, it provides an overview of accessing Python's basic libraries and how to utilize them effectively.
Mindmap
Keywords
💡Python
💡Execution
💡Environment
💡Commenting
💡Debugging
💡Function
💡Variable
💡Library
💡Documentation
💡Reset
💡Integrated Development Environment (IDE)
Highlights
Introduction to the second part of the Python file execution tutorial.
Demonstration of how to execute a Python file and specific sections within it using the 'Run File' option.
Explanation of how to add code snippets and comments using the 'Run Selection' feature and how to reset the environment.
How to clear the console using a specific command for better readability of outputs.
Using the F5 key as a shortcut to run the entire file from the keyboard.
The function of 'Run Selection' to execute selected parts of the code and its keyboard shortcut F9.
How to view and interact with the output in the console after code execution.
Using the Variable Explorer to check the values of variables like 'a' and 'b' after execution.
Differences between using 'Run File' and 'Run Selection' commands in terms of output visibility and debugging.
How to use the 'Run File' function as an alternative to icons and keyboard shortcuts.
The importance of understanding the output and how it relates to the code's execution for debugging purposes.
How to execute specific lines of code using the 'Run Selection' command or F9 for detailed debugging.
The capability to run multiple lines or blocks of code sequentially for testing and development.
Using comments to improve code readability and the process of adding comments to code.
The process of clearing the console and environment to start fresh, especially after running multiple scripts.
How to delete specific variables from the environment using the 'del' command followed by the variable name.
The option to reset the entire environment using the '%reset' command in the console.
Using the Variable Explorer to delete all variables at once for a clean environment.
Introduction to basic libraries in Python such as NumPy, pandas, matplotlib, and scikit-learn for data science problems.
How to access and utilize sub-libraries within the main libraries in Python.
The method to access detailed documentation of Python libraries and sub-libraries for better understanding.
Transcripts
ఇంట్రడక్షన్ టు స్పైడర్ పై 2వ ఉపన్యాసానికి
స్వాగతం. ఈ ఉపన్యాసంలో, పైథాన్ ఫైల్ను ఎలా
అమలు చేయాలో, కొన్నింటిని ఎలా అమలు చేయాలో
చూడబోతున్నాం. రన్ ఉపయోగించి కోడ్ ముక్కలు
మరియు వ్యాఖ్యలను ఎలా జోడించాలో మరియు
పర్యావరణాన్ని ఎలా రీసెట్ చేయాలో కూడా
చూద్దాం మరియు కన్సోల్ను క్లియర్ చేయండి.
కాబట్టి, ఫైల్ ఎగ్జిక్యూషన్తో ప్రారంభిద్దాం. ఐకాన్
బార్లో ఎగువన మీరు ఆకుపచ్చ త్రిభుజాన్ని
చూస్తారు, దాని ముగింపు కుడివైపుకి చూపబడుతుంది;
ఇప్పుడు దీనిని రన్ ఫైల్ ఎంపిక అని పిలుస్తారు
మరియు ఇది ఒకేసారి మొత్తం ఫైల్ను అమలు
చేయడానికి మీకు సహాయపడుతుంది. మరియు F5 నొక్కడానికి
కీబోర్డ్ నుండి సమానమైన సత్వరమార్గం. ఇప్పుడు,
మీరు కోడ్ యొక్క కొన్ని విభాగాలను
లేదా కోడ్ యొక్క కొన్ని పంక్తులను
అమలు చేయాలనుకుంటే, మీరు దానిపై క్లిక్
చేయవచ్చు ఎంపిక ఎంపికను అమలు చేయండి మరియు
ఇది ఎంచుకున్న పంక్తిని అమలు చేయడానికి మీకు
సహాయపడుతుంది. మరియు కీబోర్డ్ నుండి సమానమైన
సత్వరమార్గం F9 నొక్కడం లేదా కంట్రోల్ ఎంటర్
నొక్కడం; లైన్ ఎంచుకున్న తర్వాత. కాబట్టి,
ఈ ఎంపికలలో ప్రతి ఒక్కటి ఎలా పనిచేస్తుందో
మరియు దానికి సంబంధించిన అవుట్పుట్లు ఏమిటో
చూద్దాం. కాబట్టి, నేను ఇప్పుడు మొదట
రన్ ఫైల్ ఎంపికతో ప్రారంభిస్తున్నాను,
ఇది మొత్తం ఫైల్ను ఒకేసారి అమలు చేస్తుంది.
కాబట్టి, మీరు కోడ్ సిద్ధంగా ఉన్న తర్వాత
మీరు ఆకుపచ్చ త్రిభుజ చిహ్నంపై క్లిక్
చేయవచ్చు మరియు మీరు చూస్తారు ఇక్కడ ఒక
అవుట్పుట్. ఈ సందర్భంలో, నేను నా మునుపటి
ఉపన్యాసంలో ఉపయోగించిన అదే స్క్రిప్ట్ ఫైల్ను
నడుపుతున్నాను. ఇప్పుడు a అనేది 11కి సమానం,
b అనేది 8 సార్లు 10కి సమానం మరియు a కామా
bని ముద్రించండి. కాబట్టి, నేను పొందే
అవుట్పుట్ ఇక్కడ a మరియు b యొక్క విలువలు.
కాబట్టి, మీరు కోడ్ను అమలు చేసిన తర్వాత;
మీరు వాతావరణంలో నిల్వ చేయబడిన విలువలను
చూస్తారు మరియు దీనిని మీరు వేరియబుల్ ఎక్స్ప్లోరర్
క్రింద కనుగొనవచ్చు. కాబట్టి, వేరియబుల్
ఎక్స్ప్లోరర్లో నా వద్ద a మరియు b యొక్క
లోయలు ఉన్నాయని మరియు అవి పూర్ణాంకం అని
మీరు చూడవచ్చు. రకం; పరిమాణం 1 ఎందుకంటే
రెండింటికీ ఒకే విలువ మరియు సంబంధిత విలువ
ఉంటుంది ప్రదర్శించబడుతుంది. ఇప్పుడు, నేను నా
కన్సోల్లో రన్ చేసిన తర్వాత; నాకు ఇక్కడ
అవుట్పుట్ ఉంది. కాబట్టి, అవుట్పుట్
ఎలా ఉంటుందో మీకు చూపించడానికి నేను
జూమ్ ఇన్ చేస్తాను. కాబట్టి, ఇది నా అవుట్పుట్,
నా విలువ a మరియు b; a అనేది 11, b అనేది 110.
ఇప్పుడు, ఈ రచనలు ప్రింట్ స్టేట్మెంట్లలో
ఉన్నందున; నాకు ఈ రెండు మాత్రమే లభిస్తాయి.
నా అవుట్పుట్గా విలువలు. కాబట్టి, గమనించదగ్గ
మరో విషయం ఏమిటంటే, మీరు రన్ ఫైల్ ఎంపికపై
క్లిక్ చేసినప్పుడల్లా, దానికి అనుగుణంగా
ఉంటుంది. ఫంక్షన్ నడుస్తుంది. కాబట్టి,
రన్ ఫైల్ కమాండ్ వాస్తవానికి మొత్తం
ఫైల్ను రన్ చేయడానికి ఉపయోగించే ఫంక్షన్
ఒకసారి. మీరు ఐకాన్ లేదా కీబోర్డ్ సత్వరమార్గాన్ని
ఉపయోగించకపోతే, మీరు మీ ఫైల్ను కూడా ఉపయోగించవచ్చు
ఈ ఆదేశం. రన్ ఫైల్ ఫంక్షన్కు ఇన్పుట్
అనేది దాని మొత్తం డైరెక్టరీతో పాటు
ఫైల్ పేరు. ఇప్పుడు, మీకు wdir అనే మరొక పరామితి
కూడా ఉంది, అంటే వర్కింగ్ డైరెక్టరీ మరియు
మీరు ఫైల్ ఏ డైరెక్టరీలో ఉందో పేర్కొనవచ్చు.
కాబట్టి, నేను డెస్క్టాప్లో నివసిస్తున్నాను;
కాబట్టి నేను అదే డైరెక్టరీని ఇచ్చాను.
కాబట్టి, ఐకాన్ లేదా కీబోర్డ్ సత్వరమార్గాన్ని
ఉపయోగించకూడదనుకుంటే, మనం ఆ రన్ ను కూడా
ఉపయోగించవచ్చు. ఫైల్ కమాండ్. కాబట్టి,
ఈ సందర్భంలో అవుట్పుట్ ప్రింట్ స్టేట్మెంట్లో
ఉన్నందున; మీరు చేయగలరు అవుట్పుట్ a మరియు
b మాత్రమే చూడటానికి. కాబట్టి, ఇప్పుడు
రన్ సెలక్షన్ ఎంపికను ఉపయోగించి కొన్ని
కోడ్ ముక్కలను ఎలా అమలు చేయాలో చూద్దాం
లేదా కీబోర్డ్ నుండి F9 కమాండ్. ఇప్పుడు,
నా మునుపటి కోడ్కు నేను a కి 14 విలువను
కేటాయిస్తున్నాను మరియు నేను పంక్తిని
ఎంచుకుంటున్నాను మరియు అప్పుడు నేను
F9 నొక్కుతున్నాను. కాబట్టి, నేను ఇక్కడ
సత్వరమార్గాన్ని ఉపయోగించబోతున్నాను;
మీరు ఈ చిహ్నాన్ని కూడా ఉపయోగించవచ్చు.
ఇప్పుడు మీరు పంక్తిని ఎంచుకుని, F9 నొక్కిన
తర్వాత, మీరు సంబంధిత అవుట్పుట్ను చూస్తారు
మీ కన్సోల్ లో ప్రదర్శించబడుతుంది; ఇప్పుడు ఇది a అనేది
14కి సమానం అని చెబుతుంది. కాబట్టి, మీరు రన్
సెలక్షన్ కమాండ్ లేదా F9 ను ఉపయోగించినప్పుడల్లా
ఈ కోడ్ లైన్లన్నీ ప్రదర్శించబడతాయి.
మీ కన్సోల్ లో. కాబట్టి, నేను మీకు ఇక్కడ
చూపించినది కన్సోల్ అవుట్పుట్. కాబట్టి,
ఇప్పుడు రెండవ పంక్తిని అమలు చేయండి, ఇది
a x 10 కి సమానం, ఆపై ఇప్పుడు F9 నొక్కండి. మీరు
అలా చేసిన తర్వాత మీరు మీ కన్సోల్లో
కోడ్ను చూస్తారు. అప్పుడు మీరు కామా
బి యొక్క ప్రింట్ అని చెప్పే లైన్ను
అమలు చేయవచ్చు మరియు ఒకసారి మీరు ఈ లైన్
ప్రింట్ను అమలు చేయవచ్చు. a కోమా b; మీరు సంబంధిత
అవుట్పుట్ను కూడా చూస్తారు. కాబట్టి,
మీరు ఒక పంక్తిని ఎంచుకుని పరుగెత్తిన
ప్రతిసారీ పరుగెత్తడాన్ని గమనించినట్లయితే,
దానికి అనుగుణంగా ఉంటుంది. కోడ్ కూడా
కన్సోల్ లో ప్రదర్శించబడుతుంది. అయితే, మీరు మొత్తం
ఫైల్ను ఒకేసారి నడిపే రన్ ఫైల్ కమాండ్ను
ఉపయోగించబోతున్నట్లయితే అప్పుడు ఈ కోడ్ పంక్తులన్నీ
కన్సోల్లో ముద్రించబడవు. కాబట్టి, రన్ ఫైల్ను
ఉపయోగించడం మరియు రన్ సెలక్షన్ కమాండ్
మధ్య ఉన్న వ్యత్యాసాలలో ఇది కూడా ఒకటి. కాబట్టి,
మీరు డీబగ్ చేయడానికి రన్ సెలక్షన్ను కూడా
ఉపయోగించవచ్చు. కాబట్టి, మీరు ప్రతి వరుస
గుండా వెళ్లాలనుకుంటే మరియు మీరు సంచులు
లేదా జలపాతాలను కనుగొనాలనుకుంటే మీరు చేసిన తప్పుల
విషయంలో మీరు రన్ సెలక్షన్ ఎంపికను
ఉపయోగించవచ్చు. కాబట్టి, రన్ సెలక్షన్ను ఉపయోగించడం
వల్ల కలిగే ప్రధాన ప్రయోజనాల్లో ఇది
ఒకటి, కానీ మళ్ళీ మీకు ఉంటే 1000 లైన్
లేదా మీకు ఉంటే. కాబట్టి, మళ్ళీ మీకు పెద్ద
కోడ్ ఉంటే, అప్పుడు మీరు దానిని ఉపయోగించడం
అసాధ్యం అవుతుంది. ఎంపిక ఎంపికను అమలు
చేయండి. కాబట్టి, ఇప్పుడు స్క్రిప్ట్
ఫైళ్ళను వ్యాఖ్యానించడానికి వెళ్దాం. కాబట్టి,
వ్యాఖ్యను జోడించడం అనేది అభివృద్ధి
చేయడానికి ఉపయోగించిన అల్గోరిథంల అవగాహనకు
సహాయపడుతుంది ఒక కోడ్. నా కుడి వైపున,
మీరు ఇప్పుడు ఒక స్నాప్షాట్ను చూడవచ్చు,
ఇది ఎలా చేయాలో వివరించే చాలా చిన్న ఉదాహరణ
మీరు ప్రాథమికంగా హాష్తో ప్రారంభించే
ఏ పంక్తిపైనైనా వ్యాఖ్యానించడానికి సిలిండర్ వాల్యూమ్
లెక్కించబడుతుంది. కాబట్టి, ఇక్కడ నేను
చేయబోయే పని యొక్క శీర్షికను వివరించాను.
ఇప్పుడు, నేను సిలిండర్ వాల్యూమ్ను లెక్కించబోతున్నాను;
ఇప్పుడు పనిని వివరించడం కాకుండా లేదా టాస్క్
ఆబ్జెక్టివ్ మీ కోడ్లోని ప్రతి వేరియబుల్స్
అర్థం ఏమిటో కూడా మీరు నిర్వచించవచ్చు.
కాబట్టి, ఇక్కడ నేను డయా అనేది వ్యాసం,
లెన్ అనేది పొడవు, వాల్యూమ్ అని చెప్పాను.
ఇప్పుడు, ఇది చాలా మంచి అభ్యాసం ఎందుకంటే
మీరు మీ కోడ్ను ఎవరికైనా ఇవ్వబోతున్నట్లయితే
లేదా మీరు భవిష్యత్తులో తిరిగి సందర్శించబోతున్నట్లయితే,
మీరు ఏమి చేశారో తెలుసుకోవాలనుకోవచ్చు.
మరియు మీరు ఎందుకు చేసారు. ఇప్పుడు,
మీరు కేవలం ఒక పంక్తికి బదులుగా బహుళ పంక్తులను
కూడా వ్యాఖ్యానించవచ్చు. కాబట్టి, బహుళ పంక్తులకు
వ్యాఖ్యానించడానికి వ్యాఖ్యానించాల్సిన
పంక్తులను ఎంచుకోండి, ఆపై కంట్రోల్ ప్లస్
వన్ నొక్కండి; ఇప్పుడు, ఇది కీబోర్డ్ సత్వరమార్గం
మరియు ప్రత్యామ్నాయ మార్గాలు మెనూలోని
ఎడిట్ ఎంపికకు వెళ్లి, ఆపై కామెంట్ లేదా
అసంపూర్తి పంక్తులను ఎంచుకోండి. మీరు
కీబోర్డ్ సత్వరమార్గం కూడా కామెంట్ అసంపూర్తి
పక్కన ప్రదర్శించబడటం చూడవచ్చు. ఎడిట్
మెనూ కింద ఉన్న ఎంపిక. నేను ఇంతకు ముందు
చెప్పినట్లుగా, మీ కోడ్ను మరింత అర్థమయ్యేలా
చేయడానికి మీరు దానికి వివరణను జోడించవచ్చు.
కానీ మీరు అభివృద్ధి చెందుతున్న ప్రారంభ
దశలో ఉంటే దానిని అర్థం చేసుకోలేనిదిగా
చేయడమే కాకుండా మీరు ప్రయత్నిస్తున్న
మరియు మీ నుండి పరీక్షిస్తున్న కోడ్ అప్పుడు మీరు
వ్యాఖ్యానించడం కూడా ఉపయోగించవచ్చు
కొన్ని పంక్తులను జడంగా చేసే మార్గంగా.
కాబట్టి, దీని ద్వారా నా ఉద్దేశ్యం ఏమిటి.
కాబట్టి, మునుపటి ఉదాహరణను తీసుకుందాం,
ఇక్కడ నేను a అనేది 14, b అనేది 8 సార్లు
10 అని చెబుతాను మరియు a ని ముద్రిస్తాను
కామ బి. ఇప్పుడు నేను ప్రయత్నిస్తున్నాను
మరియు పరీక్షిస్తున్నాను మరియు నేను కేవలం
వ్యాఖ్యానిస్తే ఏమి జరుగుతుందో చూస్తున్నాను.
కాబట్టి, నేను ప్రాథమికంగా మొదటి పంక్తిని జడంగా
చేసి, ఆపై వరుస పంక్తులను నడుపుతున్నాను. ఇప్పుడు,
మీరు మీ కోడ్తో ఆడుతుంటే మరియు మీరు అభివృద్ధి
చెందుతున్న దశలో ఉంటే, అప్పుడు మీరు
చేయవచ్చు. పంక్తులను జడంగా ఉంచే మార్గంగా
వ్యాఖ్యానించడం కూడా ఉపయోగించండి.
కాబట్టి, ఇప్పుడు ఇది కమిట్ చేయడం
యొక్క మరొక ఉపయోగం. కాబట్టి, ఇప్పటి
వరకు మొత్తం ఫైల్ను ఒకేసారి ఎలా అమలు
చేయాలో మరియు కొన్ని పంక్తులను ఎలా అమలు
చేయాలో చూశాము. వాస్తవానికి, మీ కోడ్కు వివరణను
జోడించే మార్గంగా వ్యాఖ్యానించడాన్ని
కూడా మేము చూశాము. ఇప్పుడు కన్సోల్
మరియు పర్యావరణాన్ని ఎలా క్లియర్ చేయాలో
చూద్దాం. మీరు బహుళ పంక్తుల కోడ్లను
ముద్రించిన అధిక జనాభా కలిగిన కన్సోల్ను
కలిగి ఉంటే మరియు బహుళ అవుట్పుట్లు;
అప్పుడు మీరు దానిని క్లియర్ చేసి కొత్తగా
ప్రారంభించాలనుకోవచ్చు. కాబట్టి, నేను కోడ్లను
అమలు చేసిన ఈ ఉదాహరణను తీసుకుందాం; నాకు
మునుపటి మాదిరిగానే కోడ్లు ఉన్నాయి.
మరియు నేను వాటిని నడుపుతున్నాను. కాబట్టి,
నా కన్సోల్ ప్రస్తుతం ఇలా కనిపిస్తుంది;
ఇప్పుడు నేను దానిని క్లియర్ చేయాలనుకుంటే.
కాబట్టి, మీరు కన్సోల్ లో% క్లియర్ అని టైప్
చేయవచ్చు మరియు ఒకసారి మీరు ఎంటర్ నొక్కితే,
మీ మొత్తం కన్సోల్ స్పష్టంగా. ఇప్పుడు,
నియంత్రణను ఉపయోగించడానికి ప్రత్యామ్నాయ మార్గాలు
మరియు కీబోర్డ్ నుండి ఒక సత్వరమార్గం ఇది
కూడా పనిచేస్తుంది; కాబట్టి ఇది కన్సోల్ను
క్లియర్ చేయడం. ఇప్పుడు, మీరు కన్సోల్ను క్లియర్
చేసిన తర్వాత అది ఇలా కనిపిస్తుంది;
నాకు ఇక్కడ స్నాప్షాట్ ఉంది, అది చెబుతుంది
మీరు దానిని క్లియర్ చేసిన తర్వాత కన్సోల్
ఎలా కనిపిస్తుంది. ఇక్కడ గమనించదగ్గ
ముఖ్యమైన విషయం ఏమిటంటే; కాబట్టి నేను నా
కన్సోల్ను క్లియర్ చేసినప్పుడల్లా
అవుట్పుట్ మాత్రమే ఉంటుంది. విండోస్
క్లియర్ చేసినప్పుడు వేరియబుల్ ఎక్స్ప్లోరర్
ఇప్పటికీ చెక్కుచెదరకుండా ఉంది, అన్ని వేరియబుల్స్
ఇప్పటికీ ఉన్నాయి అక్కడ; కాబట్టి, కన్సోల్ను
క్లియర్ చేయడం అంటే మీరు దానిని క్లియర్
చేయడం లేదా ఫ్లష్ చేయడం అని మాత్రమే
అర్థం అవుట్పుట్ విండో. కాబట్టి, ఇప్పుడు
కన్సోల్ను క్లియర్ చేయడానికి బదులుగా
దాన్ని క్లియర్ చేయడానికి ఒక మార్గం ఉందా అని
చూద్దాం పర్యావరణం కూడా. కాబట్టి, నా
పర్యావరణం నుండి కొన్ని చరరాశులను
తొలగించడానికి లేదా తొలగించడానికి కూడా
నాకు ఆసక్తి ఉండవచ్చు. కాబట్టి ప్రారంభించడానికి
నా వాతావరణంలో రెండు చరరాశులు ఉన్నాయి,
అవి a మరియు b మరియు అవి కలిగి ఉన్నాయి
వరుసగా 14 మరియు 140 విలువ. కాబట్టి, ఈ
చరరాశులను ఎలా తొలగించాలో లేదా తొలగించాలో
చూద్దాం. ఇప్పుడు, ఒకే చరరాశిని తొలగించడానికి;
మీరు చరరాశి పేరు తరువాత డెల్ స్థలాన్ని
ఇవ్వవచ్చు ఇప్పుడు మీరు దీన్ని కన్సోల్
లో టైప్ చేయవచ్చు; కాబట్టి డెల్ అంటే
డిలీట్ మరియు దానిని అనుసరించాలి. ఒక
స్పేస్ మరియు తరువాత వేరియబుల్ పేరు ద్వారా.
ఇప్పుడు, మీరు ఎంటర్ నొక్కిన తర్వాత మీరు
చూసేది ఏమిటంటే ఈ సందర్భంలో వేరియబుల్స్లో
ఒకటి. b పర్యావరణం నుండి తొలగించబడింది.
కాబట్టి, ఇక్కడ మీరు వేరియబుల్ b పర్యావరణం
నుండి తొలగించబడిందని చూడవచ్చు. ఇప్పుడు,
ఒకే చరరాశిని తొలగించే బదులు మనం దాని నుండి
బహుళ చరరాశిని కూడా తొలగించవచ్చు పర్యావరణం.
ఇప్పుడు ఇప్పటికీ అదే కమాండ్ డెల్
ను ఉపయోగించండి, కానీ కేవలం ఒక చరరాశిని
ఇవ్వడానికి బదులుగా; మీరు ఇస్తారు రెండు
చరరాశులు మరియు మీరు చరరాశులను కామాతో
వేరు చేసేలా చూసుకోవాలి. ఇప్పుడు, మీరు నాతో
పాటు టైప్ చేస్తుంటే, దయచేసి వాతావరణంలో
బి కూడా ఉందని నిర్ధారించుకోండి. ఆపై మీరు ఈ కోడ్ను
టైప్ చేయవచ్చు. కాబట్టి, మీరు ఎంటర్ నొక్కిన
తర్వాత మొత్తం మెమరీ ఫ్లష్ అయిపోయిందని
మరియు రెండూ ఉన్నాయని మీరు చూడవచ్చు. ఈ
విలువలు తొలగించబడ్డాయి. కాబట్టి, వేరియబుల్స్ను
ఒక్కొక్కటిగా వదులుకునే బదులు, మీరు కూడా
వాటిని క్లియర్ చేయడానికి ఆసక్తి కలిగి ఉండవచ్చు.
ఒకేసారి మొత్తం పర్యావరణం. కాబట్టి, దాని గురించి
వెళ్ళడానికి రెండు మార్గాలు ఉన్నాయి,
మొదటి మార్గం% రీసెట్ ఆదేశాన్ని ఉపయోగించడం
కన్సోల్. ఇప్పుడు, ఒకసారి మీరు "% రీసెట్"
అని టైప్ చేసి, "ఎంటర్" నొక్కితే, అది మిమ్మల్ని
ఇలా చదివే పంక్తితో ప్రాంప్ట్ చేస్తుంది
ఒకసారి తొలగించిన తర్వాత, చరరాశులను
తిరిగి పొందలేము; అవును లేదా కాదు
అని కొనసాగించండి; y అంటే అవును మరియు
n. ఇది లేదు అని సూచిస్తుంది. ఇప్పుడు, ఇది మీరు
అనుకోకుండా శాతం రీసెట్ను టైప్ చేయలేదని
నిర్ధారించడానికి మరియు ఇది మీరు ముఖ్యమైన
చరరాశులను తొలగించకుండా చూసుకోవడానికి చెక్
యొక్క మరొక పొర మీ వాతావరణంలో. ఇప్పుడు,
మీరు ముందుకు వెళ్లాలనుకుంటే y అని టైప్ చేయండి;
లేకపోతే మీరు n అని టైప్ చేయవచ్చు మరియు
ఇప్పుడు ఒకసారి. మీరు ఎంటర్ నొక్కితే,
మొత్తం వాతావరణం క్లియర్ చేయబడిందని
మీరు చూస్తారు. కాబట్టి, ఇది కమాండ్ను ఉపయోగిస్తోంది.
ఇప్పుడు, ఐకాన్ ఉపయోగించి ఎన్విరాన్మెంట్ను
ఎలా క్లియర్ చేయాలో చూద్దాం. ఇప్పుడు,
వేరియబుల్ ఎక్స్ప్లోరర్ పైన ఇక్కడ కొన్ని
ఐకాన్లు ఉన్నాయి; ఒకటి తీవ్ర స్థాయిలో
ఉంది. కుడివైపు ఎరేజర్ లాగా కనిపిస్తుంది.
కాబట్టి, ఇప్పుడు ఐకాన్ పై క్లిక్
చేయండి, అది మిమ్మల్ని సంభాషణ పెట్టెకు
పంపుతుంది; మీరు అన్నింటినీ క్లిక్
చేస్తే చరరాశులు తొలగించబడతాయి. కాబట్టి,
ఇది చరరాశులను తొలగిస్తున్నప్పుడు, అన్ని చరరాశులు తొలగిస్తున్నట్లు
చెప్పే పంక్తితో కూడా ప్రాంప్ట్ చేస్తుంది
కాబట్టి, ఇప్పటి వరకు మనం మొత్తం
ఫైళ్ళను లేదా కొన్ని పంక్తుల కోడ్లను
ఎలా అమలు చేయాలో చూశాము. మీరు వ్రాసిన
కోడ్ను మరియు కన్సోల్ మరియు పర్యావరణాన్ని
ఎలా క్లియర్ చేయాలో వ్యాఖ్యానించడానికి.
కాబట్టి, ఇప్పుడు పైథాన్లోని కొన్ని
ప్రాథమిక లైబ్రరీలను పరిశీలిద్దాం. ఇప్పుడు,
పైథాన్ను వ్యవస్థాపించే సమయంలో నాలుగు ప్రధాన
గ్రంథాలయాలు వ్యవస్థాపించబడతాయి. ఇవి న్యూమెరికల్
పైథాన్ను సూచించే నంపై, డేటాఫ్రేమ్ను
ప్యానెల్ చేసిన పాండాస్, మ్యాట్ప్లోట్లిబ్.
ఇది మెషిన్ లెర్నింగ్ కోసం ఉపయోగించే విజువలైజేషన్
అండ్ స్క్లియర్న్ ను సూచిస్తుంది.
కాబట్టి, ఇవి డేటా సైన్స్ సమస్యను పరిష్కరించడానికి
ముఖ్యమైన నాలుగు ప్రధాన లైబ్రరీలు.
కాబట్టి, ఇవి మాతృ గ్రంథాలయాలు; వీటిలో
ఉప గ్రంథాలయాలు కూడా ఉన్నాయి. కాబట్టి,
లైబ్రరీలోని విషయాలను యాక్సెస్ చేయడానికి,
మీరు మొదట లైబ్రరీని దిగుమతి చేసుకోవాలి.
కేసు నేను నమ్పైని దిగుమతి చేస్తున్నాను.
ఇప్పుడు డిర్ డైరెక్టరీని సూచిస్తుంది; కాబట్టి
ఇది లైబ్రరీ యొక్క డైరెక్టరీ; ఈ సందర్భంలో
ఇది నమ్పై. ఇప్పుడు, నేను మొత్తం డైరెక్టరీని
కంటెంట్ అని పిలువబడే వేరియబుల్ పేరుకు
సేవ్ చేస్తున్నాను మరియు నేను నేను
ఆబ్జెక్ట్ కంటెంట్ను మాత్రమే ప్రింట్
చేస్తున్నాను. కాబట్టి, మీరు మీ కన్సోల్లో
ఈ మూడు లైన్ల కోడ్ను అమలు చేసిన తర్వాత
అన్ని సబ్ లైబ్రరీలు పనిచేస్తాయి మరియు
ముద్రించబడతాయి కాబట్టి, సబ్ లైబ్రరీని
యాక్సెస్ చేయడానికి ఇది ఒక మార్గం. కాబట్టి,
ఇప్పుడు ఇది కొంచెం శ్రమతో కూడుకున్నది
ఎందుకంటే మీరు నిజంగా అన్నింటినీ దాటాలి.
సబ్ లైబ్రరీలు ఏవి కలిగి ఉన్నాయో తెలుసుకోవడానికి
మరియు మీ కన్సోల్ కూడా అధిక జనాభా
కలిగి ఉంటుంది. ఇప్పుడు, హెల్ప్ ట్యాబ్ కింద
మీకు ఆబ్జెక్ట్ అని పేరు పెట్టబడిన సెర్చ్
బాక్స్ ఉంది; నన్ను జూమ్ చేయనివ్వండి.
ఇది ఎలా కనిపిస్తుందో మీకు చూపించడానికి.
ఇప్పుడు, ఆబ్జెక్ట్ కింద మీరు మీ లైబ్రరీ
పేరును ప్రస్తావించబోతున్నారు. కాబట్టి, ఈ సందర్భంలో
నేను NumPy గురించి ప్రస్తావించాను; మీరు నొక్కిన క్షణం
డాక్యుమెంటేషన్ పాప్స్ ఎంటర్ చేయండి
పైకి. ఇప్పుడు, డాక్యుమెంటేషన్ పైథాన్ ఏమి చేస్తుందో
మీకు చెబుతుంది; అది ఏమి అందిస్తుంది
మరియు పైథాన్ను ఎలా ఉపయోగించాలో చెబుతుంది
డాక్యుమెంటేషన్. ఇప్పుడు, అది కాకుండా
మీరు క్రిందికి స్క్రోల్ చేస్తే, మీరు ఉప లైబ్రరీల
జాబితాను కూడా చూడవచ్చు NumPy కింద అందుబాటులో
ఉన్నాయి. కాబట్టి, NumPy క్రింద అందుబాటులో
ఉన్న సబ్ లైబ్రరీలు లీనియర్ ఆల్జీబ్రా,
ఫోరియర్ ట్రాన్స్ఫార్మ్ నిత్యకృత్యాలు, బహుపది
సాధనాలు మొదలైనవి. ఇప్పుడు, మీరు ప్రతి
సబ్ లైబ్రరీకి నిర్దిష్ట డాక్యుమెంటేషన్
కావాలనుకుంటే; కాబట్టి మీరు చేయవచ్చు. శోధన
పెట్టెలో లైబ్రరీ పేరును టైప్ చేయండి,
దానిని డాట్ తో ఫాలో అప్ చేయండి, ఆపై సబ్
లైబ్రరీ పేరు. కాబట్టి, నేను నంపీ నుండి
సబ్ లైబ్రరీ లిబ్ను యాక్సెస్ చేయాలనుకుంటే
చెప్పండి; అప్పుడు నేను వెళ్తున్నాను
సెర్చ్ బాక్స్ ఆబ్జెక్ట్ కింద numpy.lib అని వ్రాయండి.
కాబట్టి, ఈ విధంగా మీరు అన్ని లైబ్రరీలు
మరియు సబ్ లైబ్రరీల యొక్క వివరణాత్మక
డాక్యుమెంటేషన్ను పొందుతారు. పైథాన్.
కాబట్టి, ఈ ఉపన్యాసంలో సంగ్రహంగా చెప్పాలంటే
పైథాన్ స్క్రిప్ట్ ఫైళ్ళను ఎలా అమలు
చేయాలో, ఎలా వ్యాఖ్యానించాలో చూశాము. కోడ్ల యొక్క
ఒకే పంక్తులు మరియు కోడ్ల యొక్క బహుళ
పంక్తులు, కన్సోల్ మరియు పర్యావరణాన్ని
ఎలా క్లియర్ చేయాలి మరియు పైథాన్లోని
కొన్ని ప్రాథమిక లైబ్రరీలను ఎలా యాక్సెస్
చేయాలి. ధన్యవాదాలు .
浏览更多相关视频
Belajar Python [Dasar] - 03 - Cara Kerja Program dan bytecode
How to set up Python on Visual Studio Code
Introduction to Spyder - Part 1
Python Tutorial for Beginners with VS Code 🐍
Lecture 04: Demonstration - I
Linux Sysadmin Basics 4.1 -- Filtering Output and Finding Things (&&, cut, sort, uniq, wc, grep)
5.0 / 5 (0 votes)