0% found this document useful (0 votes)
10 views

First Practice - Ipynb - Colab

Hd8wjxua8sjje oo xhcbox djnxiuqbsjc7abdjxi

Uploaded by

gipat30957
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views

First Practice - Ipynb - Colab

Hd8wjxua8sjje oo xhcbox djnxiuqbsjc7abdjxi

Uploaded by

gipat30957
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

10/18/24, 2:46 PM First Practice.

ipynb - Colab

1+6

a=3

b=4

a+b

a='sdf'

'sdf'

a="sdf"

'sdf'

print(a)

sdf

2*3

2**3

b==8

False

'single'

'single'

"double"

'double'

#hello
'I am Ngansa Nganam'

'I am Ngansa Nganam'

https://colab.research.google.com/drive/194GNiJfJSHyYr6CrJWkT06B9l2OgGGqN#scrollTo=X2ZCSD_ngv3n&printMode=true 1/4
10/18/24, 2:46 PM First Practice.ipynb - Colab
a=[1,2,3,4]

b=[5,6,7,9]

a+b

[1, 2, 3, 4, 5, 6, 7, 9]

c=a+b

print(c)

[1, 2, 3, 4, 5, 6, 7, 9]

print(3)

print(a+b)

[1, 2, 3, 4, 5, 6, 7, 9]

print(c[3])

print(len(c))

len(c)

a=([1,2,3,4],[5,6,7,8,9])

print(a[0])

[1, 2, 3, 4]

print(a[0][0])

print(a[0][2])

print(a[1][3])

a='I am from'

b=' Maihua'

c=" village"

concat=a + b + c
concat
concat

'I am from Maihua village'

concat

'I am from Maihua village'

concat.split()

https://colab.research.google.com/drive/194GNiJfJSHyYr6CrJWkT06B9l2OgGGqN#scrollTo=X2ZCSD_ngv3n&printMode=true 2/4
10/18/24, 2:46 PM First Practice.ipynb - Colab

['I', 'am', 'fromMaihuavillage']

if 'Maihua' in concat.split():
print("is available")
else:
print("not available")

is available

if "hello" in concat.split():
print('is good')
else:
print('is bad')

is bad

if 'bas' in concat.split():
print("is not")

concat.lower()

'i am from maihua village'

concat.upper()

'I AM FROM MAIHUA VILLAGE'

!pip install numpy

Requirement already satisfied: numpy in /usr/local/lib/python3.10/dist-packages (1.26.4)

!pip install pandas

Requirement already satisfied: pandas in /usr/local/lib/python3.10/dist-packages (2.2.2)


Requirement already satisfied: numpy>=1.22.4 in /usr/local/lib/python3.10/dist-packages (from pandas) (1.26.4)
Requirement already satisfied: python-dateutil>=2.8.2 in /usr/local/lib/python3.10/dist-packages (from pandas) (2.8.2)
Requirement already satisfied: pytz>=2020.1 in /usr/local/lib/python3.10/dist-packages (from pandas) (2024.2)
Requirement already satisfied: tzdata>=2022.7 in /usr/local/lib/python3.10/dist-packages (from pandas) (2024.2)
Requirement already satisfied: six>=1.5 in /usr/local/lib/python3.10/dist-packages (from python-dateutil>=2.8.2->pandas) (1.16.0)

import numpy as np

import pandas as pd

df= pd.DataFrame({'A': [1,2,np.nan],


'B': [5, np.nan, np.nan],
'C': [1,2,3]})

df

A B C

0 1.0 5.0 1

1 2.0 NaN 2

2 NaN NaN 3

df= pd.DataFrame({'A': [1,2,np.nan], 'B': [5, np.nan, np.nan], 'C': [1,2,3]})

df

A B C

0 1.0 5.0 1

1 2.0 NaN 2

2 NaN NaN 3

df.dropna(axis=1
)

https://colab.research.google.com/drive/194GNiJfJSHyYr6CrJWkT06B9l2OgGGqN#scrollTo=X2ZCSD_ngv3n&printMode=true 3/4
10/18/24, 2:46 PM First Practice.ipynb - Colab

0 1

1 2

2 3

df.dropna(axis=1)

0 1

1 2

2 3

df= pd.DataFrame({'A': [1,3,3], 'B': [3, np.nan, np.nan], 'C': [1,4,3]})

df

A B C

0 1 3.0 1

1 3 NaN 4

2 3 NaN 3

df.dropna(axis=1)

A C

0 1 1

1 3 4

2 3 3

df.dropna(axis=0)

A B C

0 1 3.0 1

Start coding or generate with AI.

https://colab.research.google.com/drive/194GNiJfJSHyYr6CrJWkT06B9l2OgGGqN#scrollTo=X2ZCSD_ngv3n&printMode=true 4/4

You might also like