Dav Lab
Dav Lab
Python libraries:-
● NumPy
● Pandas
● Matplotlib
● PyTorch
● SciKit-Learn
NumPy ;
In Python we have lists that serve the purpose of arrays, but they are slow to
process.
Arrays are very frequently used in data science, where speed and resources
are very important.
import numpy as np
a = np.array([1, 2, 3]) :
b = np.zeros((2, 3)) :-
Return a new array of given shape and type, filled with zeros.
c = np.ones((2, 3))
Return a new array of given shape and type, filled with ones.
2] Pandas:-
Pandas is a library for data manipulation and analysis, providing data structures and
operations for manipulating numerical tables and time series.
Pandas are generally used for data science but have you wondered why? This is
because pandas are used in conjunction with other libraries that are used for data
science. It is built on the top of the NumPy library which means that a lot of structures of
NumPy are used or replicated in Pandas. The data produced by Pandas are often used
as input for plotting functions of Matplotlib, statistical analysis in SciPy, and machine
learning algorithms in Scikit-learn. Here is a list of things that we can do using Pandas.
Functions:-
Code snippets:
python
import pandas as pd
df = pd.read_csv('data.csv')
3] Matplotlib:
Functions:
Code snippets:
python
x = [1, 2, 3]
y = [4, 5, 6]
plt.plot(x, y)
plt.scatter(x, y)
plt.hist(x)
4] Scikit-learn:
Functions:
Code snippets:
python
model = LinearRegression()
model.fit(X_train, y_train)
kmeans = KMeans(n_clusters=3)
kmeans.fit(X)
5] SciPy:
Functions:
Code snippets:
python
p = norm.pdf(0, 1)
result = quad(func, 0, 1)
R libraries:-
● Dplyr
● ggplot2
● tidyr
● Shiny
● Plotly
1] Dplyr:-
Functions:
Code snippets:
r
library(dplyr)
2] ggplot2:
Functions:
Code snippets:
library(ggplot2)
2] tidyr:
Functions:
library(tidyr)
3]Shiny:
Functions:
Code snippets:
library(shiny)
ui <- fluidPage(
plotOutput("plot1")
plot(data)
})
}
4] Plotly:
Functions:
Code snippets:
library(plotly)