Ml_Python_Basics
Ml_Python_Basics
3. What are the differences between lists and tuples? Write a program to implement
lists and tuples in Python.
- Lists: Mutable (modifiable), slower, use more memory.
- Tuples: Immutable (cannot be changed), faster, use less memory.
```python
# Example
my_list = [1, 2, 3]
my_tuple = (4, 5, 6)
print("List:", my_list)
print("Tuple:", my_tuple)
```
5. Explain the differences between NumPy, SciPy, and Pandas in Python numerical
computation.
- NumPy: Used for numerical computations and arrays.
- SciPy: Built on NumPy, used for advanced scientific computations.
- Pandas: Used for data manipulation and analysis.
6. Describe the primary data structures used in NumPy, SciPy, and Pandas, and
provide examples of their applications.
- NumPy: Uses arrays (ndarray) for numerical operations.
- SciPy: Uses sparse matrices and optimization tools.
- Pandas: Uses DataFrames for structured data analysis.
12. What is Scikit-learn? What are some common machine learning tasks that can be
performed using Scikit-learn?
- Scikit-learn is an ML library built on NumPy and SciPy.
- Tasks: Classification, regression, clustering, dimensionality reduction, and
model evaluation.