1-Amaliyot ishi: 2-Amaliyot ishi 3-Amaliyot ishi



Download 3,82 Mb.
Sana19.04.2023
Hajmi3,82 Mb.
#930523
Bog'liq
Arslonov Siyovush


Arslonov Siyovush 941-19 guruh talabasi
1-Amaliyot ishi:



2-Amaliyot ishi



3-Amaliyot ishi






4-Amaliyot ishi


5-Amaliyot ishi
12. Тўплам элементларини топинг, агарда
А = {1, 2, 4, 5}; B = {1, 3, 6, 7}; C = {3, 2, 6, 7}.


6-Amaliyot ishi
y = sinx + cosx grafikini chizish
Kodi:
import numpy as np
import matplotlib.pyplot as plt

# Define the x values


x = np.linspace(0, 2*np.pi, 100)

# Compute the y values


y = np.sin(x) + np.cos(x)

# Create a figure and axis


fig, ax = plt.subplots()

# Plot the curve


ax.plot(x, y)

# Add labels and title


ax.set_xlabel('x')
ax.set_ylabel('y')
ax.set_title('y = sin(x) + cos(x)')

# Display the plot


plt.show()

Natija:


7-Amaliyot ishi


8-Amaliyot ishi
How to do Fuzzy Matching on Pandas Dataframe Column Using Python?
Kodi:
import pandas as pd
from fuzzywuzzy import fuzz
from fuzzywuzzy import process

# creating the dictionaries
dict1 = {'name': ["aparna", "pankaj", "sudhir",
"Geeku", "geeks for geeks"]}

dict2 = {'name': ["aparn", "arup", "Pankaj",
"for geeks geeks", "sudhir c",
"geeks geeks"]}

# converting to pandas dataframes
dframe1 = pd.DataFrame(dict1)
dframe2 = pd.DataFrame(dict2)

# empty lists for storing the matches
# later
mat1 = []
mat2 = []
p = []

# printing the pandas dataframes
print("First dataframe:\n", dframe1,
"\nSecond dataframe:\n", dframe2)

# converting dataframe column to
# list of elements
# to do fuzzy matching
list1 = dframe1['name'].tolist()
list2 = dframe2['name'].tolist()

# taking the threshold as 80
threshold = 80

# iterating through list1 to extract
# it's closest match from list2
for i in list1:
mat1.append(process.extractOne(
i, list2, scorer=fuzz.partial_ratio))
dframe1['matches'] = mat1

# iterating through the closest matches
# to filter out the maximum closest match
for j in dframe1['matches']:
if j[1] >= threshold:
p.append(j[0])
mat2.append(",".join(p))
p = []


# storing the resultant matches back to dframe1
dframe1['matches'] = mat2
print("\nDataFrame after Fuzzy matching using fuzz.partial_ratio:")
dframe1
Natija:



9-Amaliyot ishi
Restoran taomlari va xizmatlari uchun reytinglarni ko'rsatish uchun Matplotlib yordamida Gauss taqsimotini qanday tuzish
import numpy as np
import matplotlib.pyplot as plt

# Define the mean and standard deviation for food and service ratings


food_mean = 7.5
food_std = 1.5
service_mean = 8.0
service_std = 1.0

# Generate the x-axis values


x = np.linspace(0, 10, 1000)

# Generate the food and service distributions


food_dist = 1 / (food_std * np.sqrt(2 * np.pi)) * np.exp(-0.5 * ((x - food_mean) / food_std)**2)
service_dist = 1 / (service_std * np.sqrt(2 * np.pi)) * np.exp(-0.5 * ((x - service_mean) / service_std)**2)

# Create a figure and axis


fig, ax = plt.subplots()

# Plot the food and service distributions


ax.plot(x, food_dist, color='blue', label='Food')
ax.plot(x, service_dist, color='green', label='Service')

# Add labels and title


ax.set_xlabel('Rating')
ax.set_ylabel('Frequency')
ax.set_title('Restaurant Ratings')

# Add a legend


ax.legend()

# Display the plot


plt.show()

Natija:

Download 3,82 Mb.

Do'stlaringiz bilan baham:




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish