Skip to content

Commit 961d0c4

Browse files
author
Muhammad Ismail Shahzad
authored
csv for year added
1 parent 6a89954 commit 961d0c4

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

wrangler_script.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,9 @@
2929
data2 = data.groupby(data['Date'].dt.strftime('%Y/%m/01'))['Price'].mean()
3030
#Write the data to a csv file
3131
data2.reset_index().to_csv('Henry_Hub_Gas_Prices_Monthly.csv', header=True, index=False)
32+
33+
34+
#Now for year Group data for the same year only
35+
data_year = data.groupby(data['Date'].dt.strftime('%Y/01/01')).Price.mean()
36+
#Writing it to csv file​
37+
data_year.reset_index().to_csv('Henry_Hub_Gas_Prices_Yearly.csv', header=True, index=False)

0 commit comments

Comments
 (0)