Help on built-in function len in module builtins:
len(obj, /)
Return the number of items in a container.
None


3 Mar 2025
Introduction to VS
Installing and Importing Libraries in Python
Getting Help in Python
Introduction to Quarto
A collection of pre-written code that contains functions and modules that developers can use to solve programming tasks
Python libraries cover libraries for a wide range of tasks, including:
pandas and numpy for data analysis, cleaning, exploration, and efficient numerical computations.scikit-learn, TensorFlow for machine learning tasks such as prediction, clustering, and forecasting.statsforecast, darts and skforecast for forecasting taskspip install <library-name>.pip install numpypython !pip install numpyOnce a library is installed, you need to import it into your Python script:
Example:
Use as to create an alias for convenience (e.g., import pandas as pd or import numpy as np).
Use from … import … to call specific functions from libraries or modules :
Example:
print(), id() are always present, these are built-in namespaces.help(): Displays documentation for an object.dir(): Lists the attributes and methods of an objecttype(): Displays the type of the objectExample -1:
Example -2:
['__add__', '__class__', '__class_getitem__', '__contains__', '__delattr__', '__delitem__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__', '__getstate__', '__gt__', '__hash__', '__iadd__', '__imul__', '__init__', '__init_subclass__', '__iter__', '__le__', '__len__', '__lt__', '__mul__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__reversed__', '__rmul__', '__setattr__', '__setitem__', '__sizeof__', '__str__', '__subclasshook__', 'append', 'clear', 'copy', 'count', 'extend', 'index', 'insert', 'pop', 'remove', 'reverse', 'sort']
Quarto help us publish reproducible, production quality articles, presentations, dashboards, websites, blogs, and books in HTML, PDF, MS Word, ePub, and more.
Here’s an example of creating a bar plot using Seaborn package with a sample dataset:
# Import required libraries
import seaborn as sns
import matplotlib.pyplot as plt
# Sample data
data = {
"Category": ["A", "B", "C", "D", "E"],
"Values": [23, 45, 56, 78, 12]
}
# Convert to a DataFrame
import pandas as pd
df = pd.DataFrame(data).sort_values(by = "Values", ascending=False)
# Create a bar plot
sns.barplot(x="Category", y="Values", data=df, palette="viridis")
# Add a title and labels
plt.title("Sample Bar Plot")
plt.xlabel("Category")
plt.ylabel("Values")
# Show the plot
plt.show()
An example of creating a line graph using plotly package