A Z Cheatsheet Python DA
A Z Cheatsheet Python DA
A - Arrays
- NumPy Arrays:
- numpy.linspace(0, 1, 5): Creates an array with a specified number of evenly spaced values.
B - Boolean Operations
- Comparison Operators:
- Logical Operators:
C - Conditional Statements
- If-Else:
if condition:
# code
elif condition:
# code
else:
# code
D - Data Frames
- Pandas DataFrames:
E - Exception Handling
- Try-Except:
try:
except Exception as e:
finally:
F - Functions
- Defining Functions:
def func_name(params):
# code
return value
- Lambda Functions:
- Matplotlib:
matplotlib.pyplot.plot(x, y): Plots data.
- Seaborn:
- Pandas:
I - Iteration
- Loops:
J - JSON Handling
- JSON Operations:
K - Key Libraries
L - Lists
- Basic Operations:
M - Merging Data
- Pandas Merge:
N - NumPy Operations
- Array Operations:
O - Object-Oriented Programming
- Classes:
class ClassName:
self.attribute = attribute
def method(self):
# code
P - Plotting
- Plot Types:
Q - Querying Data
- Pandas Query:
R - Reading/Writing Files
- CSV Files:
- Excel Files:
S - Statistics
- Basic Statistics:
U - User-Defined Exceptions
- Creating Exceptions:
class CustomException(Exception):
pass
V - Variables
- Scope:
W - Web Scraping
- Requests Library:
X - XML Handling
- XML Parsing:
- PyYAML:
Z - Zipping Files
- Zip Files: