0% found this document useful (0 votes)
2 views1 page

Python Functions and Pandas Usage

The document contains Python code that defines several functions for printing stars, summing numbers, and reading a CSV file using pandas. It includes a function to sum three numbers, a function to sum a range of numbers, and demonstrates reading a CSV file with specific column names. The code also includes print statements to display results and the first 50 rows of the DataFrame.

Uploaded by

陳小姐
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views1 page

Python Functions and Pandas Usage

The document contains Python code that defines several functions for printing stars, summing numbers, and reading a CSV file using pandas. It includes a function to sum three numbers, a function to sum a range of numbers, and demonstrates reading a CSV file with specific column names. The code also includes print statements to display results and the first 50 rows of the DataFrame.

Uploaded by

陳小姐
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

def printStar():

print('********************')
printStar()
print('Learning Python now!!')
printStar()

def sum3N(a,b,c):
return a+b+c

x=sum3N(1,2,3)
print(x)

def sum2N(s,e):

total=0
for i in range(s,e+1):
total+=i
return total
print(sum2N(3,10))

def sum2N(s,e):

total=0
for i in range(s,e+1):
total+=i
return total
print(sum2N(3,10))
print(sum2N(1,100))

#pandas
import pandas as pd

df=pd.read_csv('height [Link]')
[Link]=['yrar','age','average','boy','girl']

print([Link](50))

You might also like