-
Notifications
You must be signed in to change notification settings - Fork 0
Pull_Request_for_CSV_Analysis #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
find_max.py
Outdated
| @@ -0,0 +1,8 @@ | |||
| # Function to find maximum value from the list | |||
| class Max: | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a built-in max() method in python.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done sir
main.py
Outdated
| from read_csv_all import Find | ||
|
|
||
|
|
||
| class Main: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rename this class to something else. something like Weather because main is used for different purpose.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it sir
read_csv.py
Outdated
| @@ -0,0 +1,39 @@ | |||
| from find_max import Max | |||
| class ReadFiles: | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Pep-8 missing. There must be 2 blank lines before a class.
- Why do you have to make a separate class for all these helper methods. Move all these methods inside the
Weatherclass inmain.py
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes sir you are right this is better approach.
read_csv_all.py
Outdated
| import os | ||
| from find_max import Max | ||
| from read_csv import ReadFiles | ||
| class Find: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Pep8 missing
- move these methods to the
Weatherclass.
read_csv_all.py
Outdated
| if hottest_temp == Max.find(ReadFiles.read_files(file, filename)): | ||
| li.append(filename) | ||
|
|
||
| return print(f"The overall Hottest Temperature is:- {hottest_temp} at months:- {li}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return must return some values not the print statement.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes sir I just fixed it
sadan
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Look at the rest of the codes again and use more meaningful variable names.
main.py
Outdated
| data_list.append(int(data[1])) | ||
|
|
||
| # Find the maximum temp from Max TempC | ||
| found = self.search_max(data_list) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use python max() method to find the maximum value in a list.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
when using max() method it causes an an error "ValueError: max() arg is an empty sequence"
as in my csv data there are many months those are empty in temperature column.
main.py
Outdated
| high_temp.append(Max.find(ReadFiles.read_csv_files(file, filename))) | ||
| hottest_temp = Max.find(high_temp) | ||
| # Find the maximum temp from Max TempC | ||
| found = self.search_max(data_list) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rename this variable to be more meaningful with the data. Since you are storing maximum temperature, I would name it something like max_temp
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
noted sir
… changes in some extra call of search_max method
Opening Pull request for weather data analysis.