✨ Can now retrieve total case number by date and country
This commit is contained in:
parent
2fb7fd3244
commit
44c61830df
11
Analyser.py
11
Analyser.py
|
@ -54,12 +54,11 @@ class Analyser:
|
|||
def getTotalCases(self, country, date=datetime.now().strftime('%Y-%m-%d')) -> int:
|
||||
"""
|
||||
Get the current total cases for the entered country
|
||||
:param country: The country you want the case number for
|
||||
:param date: The date for which the case number is returned. Standard is the current date.
|
||||
:param country: The country you want the case number for. Access available countries via getAvailableCountries()
|
||||
:param date: The date for which the case number is returned. Standard is the current date. Format YYYY-MM-DD
|
||||
:return: The case number
|
||||
"""
|
||||
countryData = self.df[self.df['countriesAndTerritories'].isin([country])]
|
||||
finalData = pd.DataFrame
|
||||
countryData.filter(datetime.strptime(country))
|
||||
print(finalData)
|
||||
return countryData['cases'].sum()
|
||||
mask = (countryData['dateRep'] <= date)
|
||||
countryTimeData = countryData.loc[mask]
|
||||
return countryTimeData['cases'].sum()
|
||||
|
|
2
Main.py
2
Main.py
|
@ -10,4 +10,4 @@ import Analyser as ana
|
|||
if __name__ == '__main__':
|
||||
analyser = ana.Analyser()
|
||||
country = input('What country do you want the graph for: ')
|
||||
analyser.getTotalCases(country, '2020-03-27')
|
||||
print(analyser.getTotalCases(country, '2020-03-28'))
|
||||
|
|
|
@ -11,13 +11,15 @@ pipelines:
|
|||
- step:
|
||||
deployment: production
|
||||
script:
|
||||
- echo "Running deployment to production"
|
||||
- pipe: atlassian/sftp-deploy:0.5.2
|
||||
variables:
|
||||
USER: $SFTP_Username
|
||||
SERVER: $SFTP_Host_Path
|
||||
REMOTE_PATH: $SFTP_Production_Path
|
||||
PASSWORD: $SFTP_Password
|
||||
- echo "Skipping Deployment as the website implementation is currently to complex"
|
||||
# - echo "Running deployment to production"
|
||||
# - pipe: atlassian/sftp-deploy:0.5.2
|
||||
# variables:
|
||||
# USER: $SFTP_Username
|
||||
# SERVER: $SFTP_Host_Path
|
||||
# REMOTE_PATH: $SFTP_Production_Path
|
||||
# PASSWORD: $SFTP_Password
|
||||
|
||||
# feature:
|
||||
# - step:
|
||||
# deployment: test
|
||||
|
|
Loading…
Reference in New Issue
Block a user