SurajDataScientist commited on
Commit
efdf1fa
·
verified ·
1 Parent(s): c3d0391

Update pages/Pandas.py

Browse files
Files changed (1) hide show
  1. pages/Pandas.py +12 -12
pages/Pandas.py CHANGED
@@ -133,33 +133,33 @@ elif page == "Series":
133
 
134
  st.write("iloc - can be used in 3 ways - 1.single element accessing, 2.Integer accessing, 3.Slicing")
135
  with st.echo():
136
- data.iloc[0]
137
 
138
- st.code(data.iloc[0], language='python')
139
  with st.echo():
140
- data.iloc[[0,3,2,4]]
141
 
142
- st.code(data.iloc[[0,3,2,4]], language='python')
143
 
144
  with st.echo():
145
- data.iloc[1:4]
146
 
147
- st.code(data.iloc[1:4], language='python')
148
 
149
 
150
  st.write("loc - can also be used in 3 ways - 1.single element accessing, 2.Integer accessing, 3.Slicing")
151
  with st.echo():
152
- data.loc["a"]
153
- st.code(data.loc["a"], language='python')
154
 
155
  with st.echo():
156
- data.loc[["a","d","c","b"]]
157
 
158
- st.code(data.loc[["a","d","c","b"]], language='python')
159
 
160
  with st.echo():
161
- data.loc["a":"d"]
162
- st.code(data.loc["a":"d"], language='python')
163
 
164
 
165
 
 
133
 
134
  st.write("iloc - can be used in 3 ways - 1.single element accessing, 2.Integer accessing, 3.Slicing")
135
  with st.echo():
136
+ y1 = data.iloc[0]
137
 
138
+ st.code(y1, language='python')
139
  with st.echo():
140
+ y2 = data.iloc[[0,3,2,4]]
141
 
142
+ st.code(y2, language='python')
143
 
144
  with st.echo():
145
+ y3 = data.iloc[1:4]
146
 
147
+ st.code(y3, language='python')
148
 
149
 
150
  st.write("loc - can also be used in 3 ways - 1.single element accessing, 2.Integer accessing, 3.Slicing")
151
  with st.echo():
152
+ z1 = data.loc["a"]
153
+ st.code(z1, language='python')
154
 
155
  with st.echo():
156
+ z2 = data.loc[["a","d","c","b"]]
157
 
158
+ st.code(z2, language='python')
159
 
160
  with st.echo():
161
+ z3 = data.loc["a":"d"]
162
+ st.code(z3, language='python')
163
 
164
 
165