Learning coding means GreatToCode Be more than a Coder ! Greattocode , Join GreatToCode Community,1000+ Students Trusted On Us .If You want to learn coding, Then GreatToCode Help You.No matter what It Takes !


CODE YOUR WAY TO A MORE FULFILLING And HIGHER PAYING CAREER IN TECH, START CODING FOR FREE Camp With GreatToCode - Join the Thousands learning to code with GreatToCode
Interactive online coding classes for at-home learning with GreatToCode . Try ₹Free Per Month Coding Classes With The Top Teachers . slip 2 Web technologies & Web development.

slip 2 Web technologies & Web development.

1)
<HTML>
<head><TITLE><CENTER>My City</CENTER></TITLE>
</head>
<body style="background-color:pink;">
<h1 style="text-align: center ; Color: blue;"> My City name: Pune </h1>
<h1 style="font-size=30; color: powderblue; "> ::Pune city Landmarks:: </h1>
<ul >
<li style="color : blue; font-size=20; font-family:verdana;">National Defence Academy</li>
<li style="color : red; font-size=21; font-family:arial;">Dagadusheth Halwai Ganapati Temple</li>
<li style="color : green ;font-size=19; font-family:courier;">ISKCON NVCC
28
Temple</li>
<li style="color : yellow; font-size=22; font-family:Calibri;">Pune University</li>
</ul>
<div style="background-color: lightblue;width: 210px; height: 210px; overflow: scroll;">
Pune, also called ‘Poona’, is situated in the state of Maharashtra, India.
It is also known as the ‘Queen of the Deccan’ and attained its high importance when it became the capital
of Bhonsle Marathas in the 17th century.
</div>
<img style="border: 1px solid red; border-radius: 4px; padding: 5px; width: 150px;" src="puneimage.jpg"></img>
</body>
</HTML>
------------------
2) A
# importing pandas module 

import pandas as pd 

  
# loading data set 

data = pd.read_csv('item.csv') 

  
# display the data 

print(data) 
# replacing missing values in quantity 
# column with mean of that column 

data['quantity'] = data['quantity'].fillna(data['quantity'].mean()) 

  
# replacing missing values in price column 
# with median of that column 

data['salary'] = data['salary'].fillna(data['salary'].median()) 

  
# replacing missing values in bought column with 
# standard deviation of that column 

data['age'] = data['age'].fillna(data['age'].std()) 

print(Data) 
-----------------
2)B
import matplotlib.pyplot as plt
import numpy as np

plt.title("Line Graph : Name vs Salary")

x = np.array(["Ajay", "Suresh", "Monica", "Rajesh"])
plt.xlabel("Employee Name")

y = np.array([10000, 25000, 15000, 5000])
plt.ylabel("Salary")

plt.plot(x, y)
plt.show()  
-------------------------------

2. C)
import pandas as pd
pd.set_option('display.max_rows', 10)
pd.set_option('display.max_columns', 20)
diamonds = pd.read_csv('https://raw.githubusercontent.com/mwaskom/seaborn-data/master/diamonds.csv')
print("First 10 rows:")
print(diamonds.head())

------------------
Q1)

<!DOCTYPE html>
  <html>
  <head>
  <title>About my City</title>
  <style type="text/css">
  .blink{
  font-family: arial;
  font-weight: bold;
  color: #ff5400;
  animation: blink 0.3s infinite;
  } 
  @keyframes blink{ 
  0%{
  visibility: hidden;
  } 
  50%{
  visibility: hidden;
  }
  100%{
  visibility: visible;
  } 
  }
  </style>
  </head>
  <body bgcolor="pink">
  <h1><b><font color="blue" size="20px"> SINNER </b></font></h1>
  <h3><font face="impact" color="red">Near Old Bharat Gas Agency</font></h3>
  <h3><font face="arial" color="violet">Near Renuka Jwellers</font></h3>
  <h3><font face="serif" color="yellow">Mughalsarai Railway Station</font></h3>
  <h1 class="blink" align="center">bhonsala military college nashik </h1>
  <img src="login.png" style="height:200px;width:200px" >
  </body>
  </html>



Q2)A

import csv
import statistics

# Open the CSV file in read mode
with open('data.csv', 'r') as file:
    # Create a CSV reader object
    reader = csv.reader(file)

    # Initialize variables to store the sum and count of the salary and age columns
    salary_sum = 0
    salary_count = 0
    age_sum = 0
    age_count = 0

    # Iterate over the rows in the CSV file
    for row in reader:
        # Try to convert the salary and age values to floats
        try:
            salary = float(row[1])
            age = float(row[2])
        except ValueError:
            # If the conversion fails, skip this row
            continue

        # Add the salary and age values to the sums
        salary_sum += salary
        age_sum += age

        # Increment the count of salary and age values
        salary_count += 1
        age_count += 1

    # Calculate the means of the salary and age columns
    salary_mean = salary_sum / salary_count
    age_mean = age_sum / age_count

# Open the CSV file in write mode
with open('data.csv', 'w', newline='') as file:
    # Create a CSV writer object
    writer = csv.writer(file)

    # Open the CSV file in read mode again
    with open('data.csv', 'r') as file:
        # Create a CSV reader object
        reader = csv.reader(file)

        # Iterate over the rows in the CSV file
        for row in reader:
            # Try to convert the salary and age values to floats
            try:
                salary = float(row[1])
                age = float(row[2])
            except ValueError:
                # If the conversion fails, set the values to the means
                salary = salary_mean
                age = age_mean

            # Write the row to the CSV file with the updated salary and age values
            writer.writerow([row[0], salary, age])


Q2)B

import matplotlib.pyplot as plt

# Data for the plot
names = ['Alice', 'Bob', 'Charlie', 'Dave', 'Eve']
salaries = [55000, 60000, 62000, 58000, 61000]

# Create the plot
plt.plot(names, salaries)

# Add title and axis labels
plt.title('Salary by Name')
plt.xlabel('Name')
plt.ylabel('Salary')

# Show the plot
plt.show()


Q2)C

import pandas as pd

# download the dataset from the internet
url = 'https://raw.githubusercontent.com/openai/heiweights/master/data/heiweights.csv'
df = pd.read_csv(url)

# print the first 10 rows of the dataframe
print(df.head(10))

# print the last 10 rows of the dataframe
print(df.tail(10))

# print 20 random rows of the dataframe
print(df.sample(20))

# print the shape of the dataframe
print(df.shape)


Post a Comment

0 Comments

•Give The opportunity to your child with GreatToCode Kid's • Online Coding Classes for Your Kid • Introduce Your kid To the world's of coding
•Fuel You Career with our 100+ Hiring Partners, Advance Your Career in Tech with GreatToCode. •Join The Largest Tech and coding Community and Fast Forward Your career with GreatToCode. •10000+ Learner's+ 90 % placement Guarantee. • Learning Coding is Better with the GreatToCode community .
•Greattocode Kid's •GreatToCode Career •GreatToCode Interview •GreatToCode Professional •GreatToCode for schools •GreatToCode For colleges •GreatToCods For Businesses.
Are you ready to join the millions of people learning to code? GreatToCode Pass is your one-stop-shop to get access to 1000+ courses, top-notch support, and successful job placement. What are you waiting for? Sign up now and get your future in motion with GreatToCode Pass.