slip.9
1..
Save by . html)
<html>
<body bgcolor=#c29bb8>
<form action="setb2ph1.php" method=get>
<pre>
Enter any string:<input type=text name=s>
Select seperator from following:<select name=s1>
<option> | </option>
<option> @ </option>
<option> # </option>
</select>
<input type=submit value=show_output>
</pre>
</form>
</body>
</html>
************setb2ph.php***********
<html>
<body bgcolor="#67074e">
<?php
$str = $_GET['s'];
$separator = $_GET['s1']; echo "<br>Given String: $str";
$arr=explode($separator,$str);
$words=implode(" ",$arr);
echo "<br> String into words: $words";
$str_rep=str_replace($separator,'#',$str); echo "<br>After Replacement: $str_rep";
$lpos=strrpos($str," ");
echo "<br>last word in given string:" .substr($str,$lpos);
?>
</body>
</html>
2
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
import numpy as np
import matplotlib.pyplot as plt
rand_arr = np.random.randint(0, 100, 50)
print("\n*** ____Random numbers ____***\n\n", rand_arr)
x = rand_arr
y = x * 0.5
print("\n\nLine Chart….\n\n")
plt.plot(x, '-', color='tomato', linewidth=3)
plt.xlabel("X - Axis")
plt.ylabel("Y - Axis")
plt.title("Line Chart")
plt.minorticks_on()
plt.grid(visible=True, color='silver', which='minor', alpha=0.8, ls='-', lw=1)
plt.show()
print("\n\nScatter Plot….\n\n")
plt.scatter(x, y, marker='d', c='gold', linewidth=2)
plt.xlabel("X - Axis")
plt.ylabel("Y - Axis")
plt.title("Scatter Plot")
plt.grid(visible=True, color='silver', which='major', alpha=0.8, ls='-', lw=1)
plt.show()
print("\n\nHistogram….\n\n")
plt.hist(x, color='teal')
plt.xlabel("X - Axis")
plt.ylabel("Y - Axis")
plt.title("Histogram")
plt.grid(visible=True, color='silver', which='major', alpha=0.8, ls='-', lw=1)
plt.show()
print("\nBoxPlot….\n\n")
plt.boxplot(x)
plt.xlabel("X - Axis")
plt.ylabel("Y - Axis")
plt.title("Box Plot")
plt.minorticks_on()
plt.grid(visible=True, color='silver', which='minor', alpha=0.8, ls='-', lw=1)
plt.show()
df = pd.read_csv('data.csv')
print("Shape of DataFrame is : ", df.shape)
print("\n Number of rows & Columns : ", df.size)
print("\n\n Data types for DataFrame is : \n\n", df.dtypes)
print("\n\n Feature Names in DataFrame : \n\n", df.columns)
print("\n\n Description of a Data : \n\n", df.describe())
df
Comments
Post a Comment