Gu Lab - Ipyncolab
Gu Lab - Ipyncolab
ipynb - Colab
return income_tax
https://colab.research.google.com/drive/1z6k34qWhFwdPPnclYlmIOfblFkp1djOd#scrollTo=66b715f1-7004-495d-8496-2a92a8873e66&printMode… 1/7
10/7/24, 10:46 AM Gu_lab.ipynb - Colab
Your income tax is: ₹636800.00
# Test cases
animal_call() # Default animal (mouse)
animal_call(animal='cat') # Test for cat
animal_call(animal='dog') # Test for dog
animal_call(animal='cow') # Test for cow
animal_call(animal='lion')# Test for unknown animal
squeak
meow
woof
moo
Sorry, I do not know what noise that animal makes.
https://colab.research.google.com/drive/1z6k34qWhFwdPPnclYlmIOfblFkp1djOd#scrollTo=66b715f1-7004-495d-8496-2a92a8873e66&printMode… 2/7
10/7/24, 10:46 AM Gu_lab.ipynb - Colab
return number
# Test cases
test_numbers = [1, 3, 5, 15, 23]
1
FIZZ
BUZZ
FIZZBUZZ
23
# Input list
to_search = [0, 1000, 2, 999, 5, 100, 54]
import pandas as pd
return df_cleaned
# Provide the path to your data file (replace 'your_file.csv' with your actual file path)
file_path = "D:\currency.csv"
Cleaned DataFrame:
Code Symbol Name
0 AED إ.د United Arab Emirates d
1 AFN ؋ Afghan afghani
2 ALL L Albanian lek
3 AMD AMD Armenian dram
4 ANG ƒ Netherlands Antillean gu
https://colab.research.google.com/drive/1z6k34qWhFwdPPnclYlmIOfblFkp1djOd#scrollTo=66b715f1-7004-495d-8496-2a92a8873e66&printMode… 3/7
10/7/24, 10:46 AM Gu_lab.ipynb - Colab
.. ... ... ...
158 XOF CFA West African CFA franc
159 XPF Fr CFP franc
160 YER ﷼ Yemeni rial
161 ZAR R South African rand
162 ZMW ZK Zambian kwacha
import pandas as pd
# Function to group data based on a given column and extract a specific group
def split_data_into_groups(file_path, group_column, group_value):
# Step 1: Read data into a DataFrame
df = pd.read_csv(file_path)
return grouped_data
# Example usage
file_path = "D:\grouped_data.csv" # Replace with your actual file path
group_column = 'Category' # Column to group by (e.g., 'Category')
group_value = 'A' # Group to extract (e.g., value 'A')
# Call the function to split the data into groups and retrieve the desired group
grouped_data = split_data_into_groups(file_path, group_column, group_value)
import pandas as pd
# Example usage
file_path = "D:\statistics_data.csv" # Replace with your actual file path
compute_statistics(file_path)
https://colab.research.google.com/drive/1z6k34qWhFwdPPnclYlmIOfblFkp1djOd#scrollTo=66b715f1-7004-495d-8496-2a92a8873e66&printMode… 4/7
10/7/24, 10:46 AM Gu_lab.ipynb - Colab
Quantity 2
dtype: int64
import pandas as pd
import matplotlib.pyplot as plt
# Scatter plot
plt.subplot(1, 2, 1) # Create a subplot (1 row, 2 columns, 1st plot)
plt.scatter(df[x_col], df[y_col], color='blue', marker='o')
plt.title(f'Scatter Plot of {x_col} vs {y_col}')
plt.xlabel(x_col)
plt.ylabel(y_col)
# Example usage
file_path = "D:\statistics_data (1).csv" # Replace with your actual file path or use the provided CSV
x_col = 'Item' # Column for X-axis (replace with your column name)
y_col = 'Quantity' # Column for Y-axis (replace with your column name)
# Call the function to plot the scatter plot and bar plot
data_visualization(file_path, x_col, y_col)
https://colab.research.google.com/drive/1z6k34qWhFwdPPnclYlmIOfblFkp1djOd#scrollTo=66b715f1-7004-495d-8496-2a92a8873e66&printMode… 5/7
10/7/24, 10:46 AM Gu_lab.ipynb - Colab
import pandas as pd
import numpy as np
import statsmodels.api as sm
import matplotlib.pyplot as plt
# Sample data creation (you can replace this with your own dataset)
data = {
'X': [1, 2, 3, 4, 5, 6, 7, 8, 9, 10],
'Y': [2.3, 2.9, 3.7, 4.5, 5.1, 5.8, 6.9, 7.1, 8.2, 9.0]
}
df = pd.DataFrame(data)
# Define variables
X = df['X'] # independent variable
Y = df['Y'] # dependent variable
# Predict values
predictions = model.predict(X)
https://colab.research.google.com/drive/1z6k34qWhFwdPPnclYlmIOfblFkp1djOd#scrollTo=66b715f1-7004-495d-8496-2a92a8873e66&printMode… 6/7
10/7/24, 10:46 AM Gu_lab.ipynb - Colab
Notes:
[1] Standard Errors assume that the covariance matrix of the errors is correctly specified.
C:\Users\Ranvijay\anaconda3\Lib\site-packages\scipy\stats\_axis_nan_policy.py:531: UserWarning: kurtosistest only valid for n>=20 .
res = hypotest_fun_out(*samples, **kwds)
https://colab.research.google.com/drive/1z6k34qWhFwdPPnclYlmIOfblFkp1djOd#scrollTo=66b715f1-7004-495d-8496-2a92a8873e66&printMode… 7/7