# -*- coding: utf-8 -*-
"""
Created on Fri Jun  2 17:55:35 2023

@author: stani
"""

#import streamlit as st
import pandas as pd
#import matplotlib.pyplot as plt
#import numpy as np
import datetime
from datetime import date
#import seaborn as sns

data = pd.read_excel(r'C:\Users\stani\Desktop\Webapp\st_zagora\income_data.xlsx') 
df = pd.DataFrame(data)
#import streamlit as st
#import matplotlib.pyplot as plt

# Pie chart, where the slices will be ordered and plotted counter-clockwise:
#labels = 'Frogs', 'Hogs', 'Dogs', 'Logs'
#sizes = [15, 30, 45, 10]
#explode = (0, 0.1, 0, 0)  # only "explode" the 2nd slice (i.e. 'Hogs')



#df['data'] = pd.to_datetime(df['data']).dt.date
df['year'] = pd.DatetimeIndex(df['data']).year
#datas = df['data'].year

#print(df['year'])
#

#for ele in df['year']:
df_res_period1=df[(df['data'] == 2019)] 
    # checking for date in range
 #   if ele == '2019':
        
 # Data to plot
#        labels = 'Income milk', 'Income animal', 'Income calves', 'Grand'
        #sizes = [215, 130, 245, 210]
#        colors = ['gold', 'yellowgreen', 'lightcoral', 'lightskyblue']
#        explode = (0, 0, 0, 0)  # explode 1st slice
income_milk = df_res_period1['income_milk'].sum()
income_animal = df_res_period1['income_animal'].sum()
        
        
        
print(income_milk, income_animal)