Πως να επιλέγετε γραμμές και στήλες με τη βιβλιοθήκη pandas της γλώσσας προγραμματισμού Python See below the data and the code for the result shown on image . . . How to select rows and columns in pandas # Credit : Trifonas Papadopoulos, Oct 4th, 2022, Version 2.0 # start of code —————————————————————————————– import pandas as pd import numpy as np # data data = [[‘A0001′,”,”,”,0,’variable’,0,0], [‘A0001′,’WHITE’,’S’,’Small’,1,’variation’,0,0], [‘A0001′,’WHITE’,’M’,’Medium’,2,’variation’,0,0], [‘A0001′,’WHITE’,’L’,’Large’,3,’variation’,0,0], [‘A0001′,’WHITE’,’XL’,’Extra Large’,4,’variation’,0,0], [‘A0001′,’BLACK’,’L’,’Large’,5,’variation’,0,0], [‘A0003′,”,”,”,6,’variable’,0,0], [‘A0003′,’BLACK’,’XL’,’Extra Large’,7,’variation’,0,0], [‘A0002′,”,”,”,8,’variable’,0,0], [‘A0002′,’BLACK’,’L’,’Large’,9,’variation’,0,0], [‘A0002′,’BLACK’,’XL’,’Extra Large’,10,’variation’,0,0], [‘A0004′,”,”,”,12,’variable’,0,0], [‘A0004′,’WHITE’,’S’,’Small’,12,’variation’,0,0], [‘A0004′,’RED’,’S’,’Small’,13,’variation’,0,0], [‘A0004′,’RED’,’M’,’Medium’,14,’variation’,0,0], [‘A0001′,’WHITE’,’XXL’,’2 Extra Large’,15,’variation’,0,0], ] # print list of columns print(‘–list of columns———————————————————–‘) cols = list(df.columns.values) print(cols) # dataframe with defined column names df = pd.DataFrame(data, columns=[‘parent’, ‘color’, ‘size’, ‘size_desc’, ‘order’, ‘type’, ‘quantity’,’price’]) print(”) print(‘–dataframe with defined column names—————————————‘) print(df) # end of code —————————————————————————————– If you want to see more ways to select rows and columns in pandas (Python), read my code (Version…
Excel file 1 : sales_january_2021_d.xlsx – Download : https://lnkd.in/dyT6zrCX Excel file 2 : sales_feb_2021_d.xlsx – Download : https://lnkd.in/d5aaNWiq Excel file 3 : sales_march_2021_d.xlsx – Download : https://lnkd.in/d-G2hNiM Task Collection of data from the above mentioned three different excel files and creation of a new one : sales_jan_feb_mar_2021_d.xlsx – Download : https://lnkd.in/d-PTEPtv with three different sheets : sales_data month_productivity salesperson_productivity We did a comparison between Budget and Actual Sales. The reason we did this is to know the month productivity and the salesperson productivity for months Jan, Feb and Mar 2021. All sheets, data, graphs and styling in file : sales_jan_feb_mar_2021_d.xlsx have been created automatically with python coding. Tools used : Excel, Python #programming #coding #python #productivity #data_analysis #mindstormGR / www.mindstorm.gr Code for this project from ctypes.wintypes import WORD import pandas as pd import numpy as np import matplotlib.pyplot as plt importopenpyxl from openpyxl.styles import PatternFill, Border, Side, colors, Alignment, Protection,…