Python
Python
2x & 3x versions (We are using 3x versions & usability of 2x versions have declined slowly)
In compilation, U wont get the errors line – by – line.
In Interpretation, u can get the errors line – by – line. Advantage: U can correct it instantly
While explaining all icons, the keyboard icon is to know shortcut keys
Number & Operators : Integers, floating points.
Ctrl + Enter to execute the code or Run button at the top to execute the code
Explain order of precedence using braces
Variables:
Rules for creating variables: No numbers, no space, no keywords
Dynamic typing:
No need of defining variables
Automatic assumption of data types
Strings:
“” or ‘’
String Operations:
String Methods:
Immutability:
Once the string is created, it cannot be replaced
String Formatting:
Lists:
Unlike Strings, Lists are mutable, i.e. it can be replaced
Not necessary to be a same data type.
List Methods:
Tuples:
Similar to strings they are immutable (i.e cannot be replaced), no straight braces mandatory use both.
Dictionaries:
In Python, a dictionary is a built-in data type used to store collections of items. Unlike
sequences like lists or tuples, which store elements in an ordered manner and are accessed
by numerical indices, dictionaries store elements as key-value pairs. Each key in a dictionary
must be unique, and it is associated with a corresponding value.
Methods of Dictionaries:
Nested dictionaries
Sets are unordered collection of unique elements. Similar to dictionaries, but only unique
elements.
Example
Statements:
Functions:
Decorators:
In Python, decorators are a powerful feature that allows you to modify or enhance the
behavior of functions or methods without changing their actual code. They are essentially
functions themselves that wrap around other functions, allowing you to add functionality
before or after the wrapped function executes.
Generators:
Attributes:
Tensorflow
https://pypi.org/
https://docs.python.org/3/py-modindex.html
CMD.exe Prompt
Data Frame: Data structure that represents data with rows & columns (Tabular structure)
Different ways of creating dataframe:
https://pandas.pydata.org/docs/user_guide/io.html
No proper header:
Give proper headers:
Wanna replace specifically means use The following command: Use dictionary
NUMPY:
For installing,
For importing,
Numpy Data types:
Course Structure (Module 2)
Variable: