SERob3 (python) - Տվյալների վերլուծություն գրաֆիկների միջոցով

Post Reply
davbaghdasaryan
Posts: 101
Joined: Thu Apr 09, 2020 8:08 pm

SERob3 (python) - Տվյալների վերլուծություն գրաֆիկների միջոցով

Post by davbaghdasaryan »

Data analysis through graphs | Анализ данных с помощью графиков


Այսօր մենք, ըստ գրաֆիկների, կվերլուծենք տվյալներ python ծրագրավորման լեզվի միջոցով։
Նախեւառաջ, մտնենք մեզ անհրաժեշտ կատալոգը։ Դրա համար գրում ենք՝ «cd projects», «cd SERob3» եւ «cd datavisualization»:
Оգտվելու ենք «matplotlib» գրադարանի pyplot  ֆունկցիայից։ Գրում ենք հետեւյալ հրամանը՝ «from matplotlib import pyplot as plt»:
Մենք կփորձենք գծել մի գրաֆիկ, որտեղ ցույց է տրված ըստ տարեթվերի արտադրված «SERob3» եւ «SERob2» ղեկավարիչների քանակները: Վերցված են կամայական, ոչ իրական թվեր։
Գրաֆիկի «x» առանցքի վրա տեղակայված են տարեթվերը (մեր դեպքում՝ 2015-2020թթ․-ները), «y» առանցքի վրա՝ արտադրված քանակը՝ ըստ տվյալ թվականների։ Կառուցենք գրաֆիկը «SERob3» անունով. «plt.plot(dev_x,dev_y, label = 'SERob3'»:
«y» առանցքի վրա կնշենք «SERob2»-ի արտադրված քանակը՝ ըստ տվյալ թվականների։ Կառուցենք գրաֆիկը «SERob2» անունով։
Ցուցադրում ենք գրաֆիկները։
Սեղմեք այստեղ

Code: Select all

from matplotlib import pyplot as plt

dev_x = [2015, 2016, 2017, 2018, 2019, 2020]

dev_y = [120, 305, 105, 760, 100, 150]

plt.plot(dev_x, dev_y, label = 'SERob3')

dev_z = [200, 305, 115, 460, 300, 250]

plt.plot(dev_x, dev_z, label = 'SERob2')

plt.xlabel('Year')
plt.ylabel('SERob controllers')
plt.title('release')

plt.legend()

plt.grid(True)

plt.show()
Ծրագիրը կարող է աշխատել «python3» կամ «python2» ծրագրավորման լեզուների միջոցով։ Տվյալ դեպքում մենք կաշխատացնենք այն «python3»-ի միջոցով։ Աշխատացնում ենք «graph.py» ծրագիրը:
Տերմինալի հրամաններ

Code: Select all

cd projects
cd SERob3
cd datavisualization
sudo python3 graph.py
sudo python2 graph.py
Գրաֆիկը ճիշտ է․ «x» առանցքի վրա տարեթվերն են, «y» առանցքի վրա՝ համապատասխան քանակը։ Կապույտ գույնով «SERob3»-ի գրաֆիկն է, նարնջագույնով՝ «SERob2»-ինը։
Տեսնել նկարը
Screen Shot 2020-05-22 at 14.01.17.png
Screen Shot 2020-05-22 at 14.01.17.png (37.47 KiB) Viewed 10727 times
Last edited by davbaghdasaryan on Mon Aug 02, 2021 4:05 pm, edited 3 times in total.

davbaghdasaryan
Posts: 101
Joined: Thu Apr 09, 2020 8:08 pm

Анализ данных с помощью графиков

Post by davbaghdasaryan »

Сегодня мы будем анализировать данные по графикам с помощью языка программирования Python.
В первую очередь, зайдем в необходимый нам каталог. Для этого запишем: "cd projects", "cd SERob3" и "cd datavisualization".
Воспользуемся функцией pyplot библиотеки "matplotlib". Запишем следующую команду: "from matplotlib import pyplot as plt".
Попробуем начертить график, показывающий количество произведенных контроллеров "SERob3" и "SERob2" по годам. Взяты произвольные, не реальные числа.
На оси "x" графика расположены даты (в нашем случае - 2015-2020 гг.), на оси "y" - количество производства в соответствии с заданными датами. Построим график под названием "SERob3" - "plt.plot(dev_x,dev_y, label = 'SERob3'".
На оси "y" укажем количество производства "SERob2" по годам. Построим график под названием "SERob2".
Показываем графики.
посмотреть

Code: Select all

from matplotlib import pyplot as plt

dev_x = [2015, 2016, 2017, 2018, 2019, 2020]

dev_y = [120, 305, 105, 760, 100, 150]

plt.plot(dev_x, dev_y, label = 'SERob3')

dev_z = [200, 305, 115, 460, 300, 250]

plt.plot(dev_x, dev_z, label = 'SERob2')

plt.xlabel('Year')
plt.ylabel('SERob controllers')
plt.title('release')

plt.legend()

plt.grid(True)

plt.show()
Программа может работать через языки программирования "python3" или "python2". В данном случае мы запустим ее через "python3". Запускаем программу "graph.py".
Terminal:

Code: Select all

cd projects
cd SERob3
cd datavisualization
sudo python3 graph.py
sudo python2 graph.py
График - верный. На оси "x" - даты, на оси "y" - соответствующее количество. Синим цветом изображен график "SERob3", а оранжевым - график "SERob2".
посмотреть
Screen Shot 2020-05-22 at 14.01.17.png
Screen Shot 2020-05-22 at 14.01.17.png (37.47 KiB) Viewed 10592 times

davbaghdasaryan
Posts: 101
Joined: Thu Apr 09, 2020 8:08 pm

Data analysis through graphs

Post by davbaghdasaryan »

Today we will analyze data according to the graphs using python programming language.
First of all let’s log into the required catalogue. Type “cd projects”, “cd SErob3” and “cd datavisualization”.
We are going to use the “pyplot” function of the “matplotlib” library. Type the following command: “from matplotlib import pyplot as plt”.
We will try to draw a graph where the “SERob3” and “Serob2” controllers quantity is shown according to their production date. We will use arbitrary, non real data.
Dates are located on the x-axis of the graph(in this case- 2015-2020 years), the production quantity by mentioned dates are located on the y-axis. Let’s build the graph with the “Serob3” name: “plt.plot(dev_x,dev_y, label = 'SERob3' “.
Mention the “Serob2” production quantity on the y-axis according to the given years. Build the graph with the “Serob2” name.
Display the graphs.
Code:

Code: Select all

from matplotlib import pyplot as plt

dev_x = [2015, 2016, 2017, 2018, 2019, 2020]

dev_y = [120, 305, 105, 760, 100, 150]

plt.plot(dev_x, dev_y, label = 'SERob3')

dev_z = [200, 305, 115, 460, 300, 250]

plt.plot(dev_x, dev_z, label = 'SERob2')

plt.xlabel('Year')
plt.ylabel('SERob controllers')
plt.title('release')

plt.legend()

plt.grid(True)

plt.show()
The program can be run through “python3” or “python2” programming languages. This time we will run it through “python3”. Run the “graph.ру” program.
Terminal:

Code: Select all

cd projects
cd SERob3
cd datavisualization
sudo python3 graph.py
sudo python2 graph.py
The graph is correct. The dates are located on the x-axis and the corresponding quantity is on the y-axis. The blue colour reflects the “SERob3” graph and the orange - “Serob2”.
Picture:
Screen Shot 2020-05-22 at 14.01.17.png
Screen Shot 2020-05-22 at 14.01.17.png (37.47 KiB) Viewed 10571 times

Post Reply