Data_Science_Assignment_1_Answers
Data_Science_Assignment_1_Answers
NumPy
NumPy (Numerical Python) is a powerful Python library used for numerical computing. It provides:
Importance:
- It forms the foundation for many other libraries like Pandas, SciPy, and scikit-learn.
2. Create a 3x3 NumPy array filled with random integers between 1 and 10.
import numpy as np
vector = array.reshape(1, 9)
SciPy
minimize(f, x0=0)
x = np.linspace(-10, 5, 100)
y = f(x)
plt.plot(x, y)
Pandas
import pandas as pd
df = pd.DataFrame({'Name':['A','B'],'Age':[25,30],'Salary':[60000,45000]})
df.groupby('Age')['Salary'].mean()
df.fillna(value), df.dropna()
Matplotlib
plt.plot(years, population)
axs[0].bar(...)
axs[1].pie(...)