Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import matplotlib.pyplot as plt
- import numpy as np x =
- np.linspace(0, 10, 100)
- plt.plot(x, x, label = 'linear'
- ) plt.legend() plt.show()
- Exercise Implementation:
- Create Pandas Dataframe to enter employee database which includes Sr No,
- Name, Mobile No, City Program: import pandas as pd
- # Sample employee data with Indian names
- employee_data = [
- {"Sr No": 1, "Name": "Ram", "Mobile No": "9876543210", "City": "Mumbai"},
- {"Sr No": 2, "Name": "Sham", "Mobile No": "9876543211", "City": "Delhi"},
- {"Sr No": 3, "Name": "Rohit", "Mobile No": "9876543212", "City": "Bangalore"},
- {"Sr No": 4, "Name": "Virat", "Mobile No": "9876543213", "City": "Ahmedabad"},
- # Add more employee data as needed
- ]
- # Create DataFrame employee_df =
- pd.DataFrame(employee_data)
- # Display DataFrame
- employee_df
- Use Iris Dataset from Github and perform all basic operations on Iris Dataset
- Program:
- import pandas as pd
- url =
- 'https://gist.githubusercontent.com/curran/a08a1080b88344b0c8a7/raw/0e7a9b0a5d2
- 2642a06d3d5b9bcbad9890c8ee534/iris.csv'
- iris = pd.read_csv(url)
- iris
- iris.head()-----------------------firstquery
- iris.iloc[75:77]---------------------second
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement