Found 33676 Articles for Programming

Python - Prefix sum list

Nizamuddin Siddiqui
Updated on 06-Aug-2020 13:16:17

908 Views

A list is a collection which is ordered and changeable. In Python lists are written with square brackets. You access the list items by referring to the index number. Negative indexing means beginning from the end,  -1 refers to the last item. You can specify a range of indexes by specifying where to start and where to end the range. When specifying a range, the return value will be a new list with the specified items.Example Live Demo# using list comprehension + sum() + list slicing # initializing list test_list = [3, 4, 1, 7, 9, 1] # printing original list print("The ... Read More

Python - Plotting scatter charts in excel sheet using XlsxWriter module

Nizamuddin Siddiqui
Updated on 06-Aug-2020 13:09:39

372 Views

A scatter plot is a type of plot or mathematical diagram using Cartesian coordinates to display values for typically two variables for a set of data. If the points are coded, one additional variable can be displayed.Example# import xlsxwriter module import xlsxwriter # Workbook() takes one, non-optional, argument which is the filename #that we want to create. workbook = xlsxwriter.Workbook('chart_scatter.xlsx') # The workbook object is then used to add new worksheet via the #add_worksheet() method.   worksheet = workbook.add_worksheet()       # Create a new Format object to formats cells in worksheets using #add_format() method .     # ... Read More

Python - Plotting Radar charts in excel sheet using XlsxWriter module

Nizamuddin Siddiqui
Updated on 06-Aug-2020 13:07:53

236 Views

A radar chart is a graphical method of displaying multivariate data in the form of a two-dimensional chart of three or more quantitative variables represented on axes starting from the same point.Example# import xlsxwriter module import xlsxwriter # Workbook() takes one, non-optional, argument which is the filename #that we want to create. workbook = xlsxwriter.Workbook('chart_radar1.xlsx') # The workbook object is then used to add new worksheet via the #add_worksheet() method. worksheet = workbook.add_worksheet() # Create a new Format object to formats cells in worksheets using #add_format() method . # here we create bold format object . bold = workbook.add_format({'bold': 1}) ... Read More

Python - Plotting Pie charts in excel sheet using XlsxWriter module

Nizamuddin Siddiqui
Updated on 06-Aug-2020 13:05:29

396 Views

A pie chart is a circular statistical graphic, which is divided into slices to illustrate numerical proportion. In a pie chart, the arc length of each slice, is proportional to the quantity it represents.Example# import xlsxwriter module import xlsxwriter # Workbook() takes one, non-optional, argument which is the filename #that we want to create. workbook = xlsxwriter.Workbook('chart_pie.xlsx') # The workbook object is then used to add new worksheet via the #add_worksheet() method. worksheet = workbook.add_worksheet() # Create a new Format object to formats cells in worksheets using #add_format() method .   # here we create bold format object . bold ... Read More

Python - Plotting Line charts in excel sheet using XlsxWriter module

Nizamuddin Siddiqui
Updated on 06-Aug-2020 13:03:47

338 Views

A line chart is a graphical representation of an asset's historical price action that connects a series of data points with a continuous line. This is the most basic type of chart used in finance and typically only depicts a security's closing prices over time.Example# import xlsxwriter module import xlsxwriter # Workbook() takes one, non-optional, argument which is the filename #that we want to create. workbook = xlsxwriter.Workbook('chart_Line.xlsx') # The workbook object is then used to add new worksheet via the #add_worksheet() method. worksheet = workbook.add_worksheet() # Create a new Format object to formats cells in worksheets using #add_format() method . # here we create ... Read More

Python - Plotting Doughnut charts in excel sheet using XlsxWriter module

Nizamuddin Siddiqui
Updated on 06-Aug-2020 13:02:23

236 Views

Donut Chart (also known as Doughnut chart) is a variation on a Pie chart except it has a round hole in the center which makes it look like a donut, hence the name. This empty space can be used to display additional data.Example# import xlsxwriter module import xlsxwriter # Workbook() takes one, non-optional, argument which is the filename #that we want to create. workbook = xlsxwriter.Workbook('chart_doughnut1.xlsx') # The workbook object is then used to add new worksheet via the #add_worksheet() method.   worksheet = workbook.add_worksheet() # Create a new Format object to formats cells in worksheets using # add_format() method . # here we create ... Read More

Python - Plotting Different types of style charts in excel sheet using XlsxWriter module

Nizamuddin Siddiqui
Updated on 06-Aug-2020 12:59:27

234 Views

XlsxWriter is a Python library using which one can perform multiple operations on excel files like creating, writing, arithmetic operations and plotting graphs.Example# import xlsxwriter module import xlsxwriter # Workbook() takes one, non-optional, argument which is the filename #that we want to create. workbook = xlsxwriter.Workbook('chart_styles.xlsx') #Show the styles for column and area chart types. chart_types = ['column', 'area'] for chart_type in chart_types:    # The workbook object is then used to add new worksheet via the #add_worksheet() method.    # Add a worksheet for each chart type    worksheet = workbook.add_worksheet(chart_type.title())    # set zoom option    worksheet.set_zoom(30)    # ... Read More

Python - Plotting Combined charts in excel sheet using XlsxWriter module

Nizamuddin Siddiqui
Updated on 06-Aug-2020 12:54:56

373 Views

lsxWriter is a Python library using which one can perform multiple operations on excel files like creating, writing, arithmetic operations and plotting graphs.Example# import xlsxwriter module import xlsxwriter # Workbook() takes one, non-optional, argument which is the filename #that we want to create. workbook = xlsxwriter.Workbook('chart_combined.xlsx') # The workbook object is then used to add new worksheet via the #add_worksheet() method. worksheet = workbook.add_worksheet() # Create a new Format object to formats cells in worksheets using #add_format() method . # here we create bold format object . bold = workbook.add_format({'bold': True}) # Add the worksheet data that the charts will refer ... Read More

Python - Plotting column charts in excel sheet using XlsxWriter module

Nizamuddin Siddiqui
Updated on 06-Aug-2020 12:49:10

223 Views

A column chart is a data visualization where each category is represented by a rectangle, with the height of the rectangle being proportional to the values being plotted. Column charts are also known as vertical bar charts.Example# import xlsxwriter module import xlsxwriter   # Workbook() takes one, non-optional, argument which is the filename #that we want to create. workbook = xlsxwriter.Workbook('chart_column.xlsx') # The workbook object is then used to add new worksheet via the #add_worksheet() method. worksheet = workbook.add_worksheet()   # Create a new Format object to formats cells in worksheets using #add_format() method .   # here we create bold format object . bold ... Read More

Python - Plotting charts in excel sheet with Data Tools using XlsxWriter module

Nizamuddin Siddiqui
Updated on 06-Aug-2020 12:41:27

159 Views

XlsxWriter is a Python library using which one can perform multiple operations on excel files like creating, writing, arithmetic operations and plotting graphs.Example# import xlsxwriter module import xlsxwriter # Workbook() takes one, non-optional, argument which is the filename #that we want to create. workbook = xlsxwriter.Workbook('updown_chart.xlsx') # The workbook object is then used to add new worksheet via the #add_worksheet() method. worksheet = workbook.add_worksheet() # Create a new Format object to formats cells in worksheets using #add_format() method . # here we create italic format object italic = workbook.add_format({'italic': 1})   # Add the worksheet data that the charts will refer ... Read More

Advertisements