Write a program to input values for x and n and print the sum of following
series: x+x/2 - *° /3+x*/4 + ...........Xn/n.
Answers
Answered by
4
Answer:
import pandas as pd
col=eval(input('enter the column list:'))
i=eval(input('enter the index list:'))
df=pd.DataFrame(columns=col,index=i)
print(df)
index=i
print('1.Enter all rows')
print('2.Enter one row detail')
ch=int(input('enter your choice(1/2):'))
if ch==1:
n=int(input('enter how many rows:'))
for i in range(n):
pos=index[i]
lst=eval(input('enter the list:'))
df.loc[pos,:]=lst
print(df)
rname=index[i]
elif ch==2:
rname=input('enter row name:')
lst=eval(input('enter the list:'))
df.loc[:,rname]=lst
print(df)
what is the error in this code
Similar questions
Science,
2 months ago
Sociology,
2 months ago
Social Sciences,
4 months ago
Math,
10 months ago
Science,
10 months ago