This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas as pd | |
import matplotlib.pyplot as plt | |
df= pd.read_csv("/est.csv") | |
print(df) | |
df.plot.bar() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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%%') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
x=int(input("Enter any number:")) | |
if x<0: | |
print('Negative') | |
elif x==0: | |
print('Zero') | |
else: | |
print('Positive') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def even_odd(x): | |
if x%2==0: | |
return True | |
else: | |
return False | |
a=int(input("Enter any number:")) | |
even_odd(a) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
days=365 | |
hours=24 | |
minutes=60 | |
seconds=60 | |
print("Number of seconds in a year are:",days*hours*minutes*seconds) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: ") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |