csv-file-1.0
توضیحات
This repository which was created to facilitate working with csv
| ویژگی | مقدار |
|---|---|
| سیستم عامل | OS Independent |
| نام فایل | csv-file-1.0 |
| نام | csv-file |
| نسخه کتابخانه | 1.0 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | Bernax27 |
| ایمیل نویسنده | Roman-16016@yandex.ru |
| آدرس صفحه اصلی | https://github.com/Bernax27/myrepository1/tree/main |
| آدرس اینترنتی | https://pypi.org/project/csv-file/ |
| مجوز | - |
csv_file library
Author R.A.Vidonchikov
This library provides the ability to read a csv file,
find the maximum and minimum elements in the matrix,
plot the values of the matrix elements, and also transpose the matrix to another csv file.
def __init__(self, road, new_road):
self.road = road
self.results = []
self.line = 0
self.column = 0
self.new_road = new_road
def reader_csv_file(self):
"""Reads a CSV file and print it as a list of rows."""
with open(self.road, newline='', encoding='utf-8') as file:
inp = csv.reader(file, delimiter=';', quotechar=',', quoting=csv.QUOTE_NONE)
for row in inp:
self.line += 1
self.column = 0
for number in row:
self.column += 1
number = int(float(number))
self.results.append(number)
def finder_max(self):
maximum = np.amax(self.results)
return maximum
def finder_min(self):
minimum = np.amin(self.results)
return minimum
def graph(self):
x_list = list(range(0, len(self.results)))
y1_list = list(self.results)
fig, ax = plt.subplots(figsize=(10, 5))
ax.set_title('Демонстрация заполения матрицы')
ax.set_ylabel('Числа матрицы')
plt.plot(x_list, y1_list)
plt.ylabel("", fontsize=14, fontweight="bold")
plt.show()
def transpose(self):
matrix = np.asarray(self.results).reshape(-1, self.column)
matrix = matrix.transpose()
with open(self.new_road, "w", newline='') as f:
for row in matrix:
print(' '.join(map(repr, row)), file=f)
زبان مورد نیاز
| مقدار | نام |
|---|---|
| >=3.6 | Python |
نحوه نصب
نصب پکیج whl csv-file-1.0:
pip install csv-file-1.0.whl
نصب پکیج tar.gz csv-file-1.0:
pip install csv-file-1.0.tar.gz