ARTIFICIAL CODEWALA
Menu
HOME
SITEMAP
CONTACT US
PRIVACY POLICY
SERIES SMALL CODING
ARTIFICIALCODEWALA
April 26, 2021
SERIES
SMALL
CODING
import numpy as np
import pandas as pd
obj1=pd.Series(data=[10, 20, 30,40, 50, np.nan])
#obj2=pd.Series(data=[55.6, 20.0, 30.0, 40.5], index=['a', 'b', 'c', 'a'])
#print(obj1+obj2)
#obj1=pd.Series(data=[10, 20, 30, np.nan])
#print(obj2[ : :-2])
#obj2['a']=50.4
#print(obj2)
#obj1[0:4]=15
#print(obj1)
obj1[0:4:-1]=15
print(obj1)
#obj1[0:4:2]=15
#print(obj1)
#Dataframe using Series
import pandas as pd
Lst_Weight=pd.Series(data=[42, 75, 56, 45, 55])
Lst_Age=pd.Series(data=[15, 17, 16, 15, 18])
Lst_Name=pd.Series(data=['Arnav', 'Kailash', 'Mohan', 'Manavi', 'Kavya'])
dict1={'Weight':Lst_Weight, 'Age':Lst_Age, 'Name':Lst_Name}
dtf1=pd.DataFrame(dict1, index=['Stud1', 'Stud2', 'Stud3', 'Stud4', 'Stud5'])
print(dtf1)
import pandas as pd
usid=[4285, 4286, 4287, 3434, 2456, 4567, 8976]
pasd=[7281, 7282, 7283, 6743, 8976, 8756, 4598]
nam=["ANURAG KUMAR","SAURAV KUMAR"," RAUSHAN KUMAR", "KRISHNA ", "ASHWANI", "AYUSH", "ANAND"]
df1={"USER_ID":usid, "PASWORD":pasd, "NAME":nam}
dtf1=pd.DataFrame(df1)
dtf1.to_csv("")
print(dtf1)
0 Comments
Popular Posts
Matrix Multiplication in C
August 14, 2022
Email Newsletter
September 20, 2024
Square Root
August 24, 2022
SERIES CONCEPT OF ATTRIBUTES
April 26, 2021
CONVERT FLASH TO USB USING CMD
August 14, 2022
Categories
C Programming
11
C++
1
DSA
1
HTML
1
Java oops
1
MACHINE LEARNING
1
MYSQL
5
NATURAL LANGUAGE PROCESSING
1
Pen Drive
2
PYTHON
17
SHARING APP
1
UI/UX
3
Total Pageviews
0 Comments