Python_2  1.0
Functions
data Namespace Reference

How to replace VBA with Python: OpenPyxl, Pandas, xlWings. More...

Functions

def readSheet ()
 Read the spreadsheet. More...
 
def toGPA (df, subjects)
 Change numerical grades for letters. More...
 
def main (argv=None)
 Main program for plotting the curve. More...
 

Detailed Description

How to replace VBA with Python: OpenPyxl, Pandas, xlWings.

MacOS:

Ubuntu:

Author
Paulo Roma
Since
04/11/2021
See also
doc
planilha
https://divisbyzero.com/2008/12/22/how-to-curve-an-exam-and-assign-grades/
https://www.dataquest.io/blog/excel-and-pandas/
https://www.youtube.com/watch?v=6qo3ly3-_I8&t=1342s
https://support.apple.com/guide/numbers/insert-formulas-and-functions-tan727173a8/mac
https://www.zamzar.com

Function Documentation

◆ main()

def data.main (   argv = None)

Main program for plotting the curve.

Parameters
argvcommand line arguments
  • h help
  • s subject
  • c class
  • g minimum grade
  • f curve
  • v verbose mode (plot graphics)

Usage:

  • data.py -s Maths -c B -v -f sqrt
  • data.py –subject Literature –class=C –grade=87
See also
https://divisbyzero.com/2008/12/22/how-to-curve-an-exam-and-assign-grades/
https://matplotlib.org/3.5.0/api/_as_gen/matplotlib.pyplot.subplots_adjust.html
https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.sort_values.html

References bell.plot(), bell.plot2(), bell.plot3(), readSheet(), bell.showPlot(), and toGPA().

◆ readSheet()

def data.readSheet ( )

Read the spreadsheet.

Returns
data frame and subject list.
See also
https://pandas.pydata.org/docs/reference/api/pandas.read_excel.html

References _12a_poly.exit().

Referenced by main().

◆ toGPA()

def data.toGPA (   df,
  subjects 
)

Change numerical grades for letters.

Parameters
dfdata frame.
subjectslist of subject names.
Returns
new GPA data frame.

Referenced by main().