Update pages/Pandas.py
Browse files- 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(
|
| 139 |
with st.echo():
|
| 140 |
-
data.iloc[[0,3,2,4]]
|
| 141 |
|
| 142 |
-
st.code(
|
| 143 |
|
| 144 |
with st.echo():
|
| 145 |
-
data.iloc[1:4]
|
| 146 |
|
| 147 |
-
st.code(
|
| 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(
|
| 154 |
|
| 155 |
with st.echo():
|
| 156 |
-
data.loc[["a","d","c","b"]]
|
| 157 |
|
| 158 |
-
st.code(
|
| 159 |
|
| 160 |
with st.echo():
|
| 161 |
-
data.loc["a":"d"]
|
| 162 |
-
st.code(
|
| 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 |
|