Skip to content

Instantly share code, notes, and snippets.

import pandas as pd
import matplotlib.pyplot as plt
fig=plt.figure()
ax=fig.add_axes([0,0,1,1])
apps=['AngryBird','TeenTitan','MarvelComics',
'ColorMe','FunRun','CrazyTaxi','IgramPro',
import pandas as pd
import matplotlib.pyplot as plt
df= pd.read_csv("/est.csv")
print(df)
df.plot.bar()
import pandas as pd
import matplotlib.pyplot as plt
labels=['North', 'South', 'East','West','Central']
sizes =[140, 160,140,180,110]
colors=['gold','yellowgreen','lightcoral','lightskyblue','pink']
explode=(0.1,0,0,0,0)
plt.pie(sizes,explode=explode,
labels=labels,colors=colors,shadow=True, startangle=140, autopct='%1.1f%%')
plt.plot([140,130,130,190,160,200,150,170,190,170,150,120], label='North')
plt.plot([160,200,130,200,200,170,110,160,130,140,170,200], label= 'South')
plt.plot([140,180,150,170,190,140,170,180,190,150,140,170], label='East')
plt.plot([180,150,200,120,180,140,110,130,150,190,110,140], label='West')
plt.plot([110,160,130,110,120,170,130,200,150,160,170,130], label='Central')
plt.title("Rainfall from Jan to Dec")
plt.xlabel('X-Axis')
plt.ylabel('Y-Axis')
plt.legend()
x=int(input("Enter any number:"))
if x<0:
print('Negative')
elif x==0:
print('Zero')
else:
print('Positive')
def even_odd(x):
if x%2==0:
return True
else:
return False
a=int(input("Enter any number:"))
even_odd(a)
days=365
hours=24
minutes=60
seconds=60
print("Number of seconds in a year are:",days*hours*minutes*seconds)
x,y =map(int,input("Enter Two numbers:").split())
#map() is used to make the variable an int
if(x%y)==0:
print('First number is divisible by second')
else:
print('First number is not divisible by second')
def numberedDay(firstDay, dayNumber):
days = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday']
firstIndex = days.index(firstDay)
endIndex = (firstIndex + int(dayNumber) - 1) % 7
return days[endIndex]
year = input("Year: ")
firstDay = input("First day of the year (e.g. 'Monday'): ")
dayNumber = input("Day number: ")
def feet_to_inches(x):
return x*12
def feet():
x = int(input('Enter feet : '))
return x
def disp_inches(x):
print('Number of inches :', x)