I need to copy values only from a DF to a dict for the purposes of a display function that takes a dict as an argument.
My dataframe is called databases
in the following excerpt.
DB_stat_reporting = dict()
report_month = databases.loc[databases['Date'] == reporting_month]
last_year = databases.loc[databases['Date'] == past_year]
report_month
Output:
Date Circ EB Mag bla drive Total Digi
12 2019-12-01 118324 133 1084 4928 17513 141982 23658
I need to pass the values only to a dictionary:
DB_stat_reporting['Circ'] = report_month['Circ']
DB_stat_reporting['Circ']
Produces:
12 118324
I need to run some stats on it so it needs to stay an int but I do not want the index or brackets, etc. to be printed.
Expected output:
118324
This seemed like such a simple thing but I can not get it to do this.