python pip, numpy, scipy, matplotlib Installation on Ubuntu

preview_player
Показать описание
Installation Procedure:

Launch terminal and run the following commands:

1. sudo apt install python-pip

2. pip install numpy

3. pip install scipy

4. pip install matplotlib
Рекомендации по теме
Комментарии
Автор

Thanks, it was such a concise and helpful video

parijataflowers
Автор

you did it for python 2, how to do this if i have python3 installed along with it

abhishekpandey
Автор

I had a problem saving .dxf files with Inkscape.
"Failed to import the numpy or numpy.linalg modules"
Problem solved after installing numpy.
Thank you!!!!

bendewachter
Автор

What are they for? I know that pip is a package control for python, but what are the other stuff

foozzycat
Автор

hey man, i'm commenting some codes here, please don't delete the comment
p1, Line:-from cProfile import label
import matplotlib.pyplot as plt
import numpy as np

#input values
x = np.array([10, 9, 2, 15, 10, 16, 11, 16])
y = np.array([95, 80, 10, 50, 45, 98, 38, 93])

for i in range(0, len(x)):
plt.plot(x[i], y[i], "gX")

#slope intercept cal
slope, intercept = np.polyfit(x, y, 1)
y= slope*x + intercept

#plotting co-ordinates

for i in range(0, len(x)):
plt.plot(x[i], y[i], "bo")

plt.plot(x, y, '-r', label='y=mx+b')
plt.ylabel('Risk Score on a scale of 0-100')
plt.xlabel('NO. of hours spent on Driving ')
plt.title("Linear Regression")
plt.show()
p2, diffie-hillman:-import numpy as np
import pandas as pd

#reading dataset
dataset = pd.read_csv("DT.csv")
x = dataset.iloc[:, :-1]
y = dataset.iloc[:, 5].values

#perform label encoding
from sklearn.preprocessing import LabelEncoder
labelencoder_X = LabelEncoder()

x=
print(x)

from sklearn.tree import DecisionTreeClassifier
regressor = DecisionTreeClassifier()
regressor.fit(x.iloc[:, 1:5].values, y)


#predict value for the given expression
x_in =np.array([1, 1, 0, 0])

Y_pred = regressor.predict([x_in])

print ("\n\nPrediction of given Test Data is {} ".format(Y_pred[0]))


#from sklearn.externals.six import StringIO
from six import StringIO
from IPython.display import Image
from sklearn.tree import export_graphviz
import pydotplus

dot_data = StringIO()

export_graphviz(regressor, out_file = dot_data, filled = True, rounded = True, special_characters = True)

graph =
graph.write_png("tree.png")
p3, k-means:-from statistics import mode
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd

#Data Set

X = [ [0.1, 0.6], [0.15, 0.71], [0.08, 0.9], [0.16, 0.85],
[0.2, 0.3], [0.25, 0.5], [0.24, 0.1], [0.3, 0.2]
]

#Initalize Centre Points
centers = np.array( [ [0.1, 0.6] , [0.3, 0.2] ] )
print("\n\nInitial Centriods -> {} and {}".format(centers[0], centers[1]))

#Generating the Model
from sklearn.cluster import KMeans
model = KMeans(n_clusters=2, init= centers, n_init=1)
model.fit(X)

print("Labels -> {} ".format(model.labels_))

print("\n
print("\n\t\t -- Answer of Given Questions --")
# Which cluster does P6 belongs to?
print("\n\tP6 Belongs to Cluster : {} ".format(model.labels_[5]))

# What is the population of cluster around m2?
print("\n\tPopulation around Cluster 'm2 = [0.15, 0.71]' : {} 1)))

# What is updated value of m1 and m2(New Centriods)?
print("\n\tUpdates Values of m1 and m2 'New Centriods' : {} and {}".format(model.cluster_centers_[0], model.cluster_centers_[1]))

print("\n
p4, KNN:-import numpy as np
import pandas as pd

#reading dataset
dataset = pd.read_csv("data.csv")
x = dataset.iloc[:, :-1]
y = dataset.iloc[:, 2].values

#perform label encoding
from sklearn.neighbors import KNeighborsClassifier
classifier =
classifier.fit(x.values, y)


#predict value for the given expression
X_in =np.array([6, 2])

y_pred = classifier.predict([X_in])
print("\n\n
print ("\tPrediction of the Given Values [6, 2] is : {} ".format(y_pred[0]))

classifier = KNeighborsClassifier(n_neighbors=3, weights="distance")
classifier.fit(x.values, y)

y_pred = classifier.predict([X_in])
print ("\n\tDistance Weight KNN: ", y_pred)


paulatreides
Автор

Christ that static. But it was useful anyway, thanks!

FairFuse