Adding source code files for Chapter 6

This commit is contained in:
muassif
2021-03-13 19:25:45 +04:00
committed by GitHub
parent e662762d09
commit 9589675a50
45 changed files with 625 additions and 0 deletions
+17
View File
@@ -0,0 +1,17 @@
# pandas4.py
import pandas as pd
weekly_data = {'day':['Monday','Tuesday', 'Wednesday', 'Thursday',
'Friday', 'Saturday', 'Sunday'],
'temp':[40, 33, 42, 31, 41, 40, 30],
'condition':['Sunny','Cloudy','Sunny','Rain','Sunny',
'Cloudy','Rain']
}
df = pd.DataFrame(weekly_data)
df.index = ['MON', 'TUE','WED','THU','FRI','SAT','SUN']
df.loc['TST1'] = ['Test day 1', 50, 'NA']
df.loc[7] = ['Test day 2', 40, 'NA']
print(df)