Pandas Panel.rdiv()
usa una función para obtener la división por fila y marco de datos / Panel.
Sintaxis : Panel.rdiv (otro, eje = 0)
Parámetros:
otro: DataFrame o Panel
eje: Eje sobre el que transmitirDevoluciones: Panel
Código n.º 1:
pandas como pd
importar
numpy como np
df1
=
pd. DataFrame ({
`a`
: [
`Geeks`
`Para`
,
` geeks `
,
` real`
],
`item2`
: df2}
# crear un panel
panel
=
pd.Panel.from_dict (data, orient
=
`menor`
)
print
(
"Dividiendo el panel [`b`] con df2 [`b`] usando el método rdiv() -"
)
print
(
""
, panel [< /código>
` b`
], axis
=
Salir:
panel [`b`] is - item1 item2 0 111 100 1 123 100 2 425 100 3 1333 100 Dividir el panel [`b`] con df2 [` b`] usando el método rdiv() - item1 item2 0 0.900901 1 1 0.813008 1 2 0.235294 1 3 0.075019 1
Código # 2:
import
pandas as pd
=
pd.DataFrame ({
`a `
: [
` Geeks`
,
`Para`
# crear un panel
panel
=
pd.Panel.from_dict (data, orient
=
`menor `
)
print
])
print
(
"Recién creado dataframe con valores aleatorios ‚Äã‚Äãis -"
, df2)
)
imprimir
Salir:
panel [`b`] es - item1 Item2 0 11.000 11.000 1 1.025 1.025 2 333.000 333.000 3 114.480 114.480 4 1333.000 1333.000 Recién creamos datos de datos con valores aleatorios, Äíamos - Item1 Item2 0 0.364764 0.680203 0.858278 2 0.519905 0.701869 3 0.429503 0.033674 4 0.151454 0.658271 Panel divisor [`B `] con df2 usando el método rdiv() - item1 0.0618 0.03316034 2 0.001561 0.002108 3 0.003752 0.000294 4 0.000114 0.000494
Código # 3:
importar
numpy como np
` a`
: [
`Geeks `
,
` For`
,
`geeks`
Salir:],
`b`
: [
# crear un panel
panel
=
print
(
"Dividir panel [`b`] [`item1`] con df2 [`b`] o panel [`b`] [`item2`] usando el método rdiv() - "
)
, panel [
`b`
] [
panel [` b`] is - item1 item2 0 11.000 10 1 1.025 10 2 333.000 10 3 114.480 110 4 1333.000 110 Panel divisorio [`b`] [` item1`] con df2 [`b`] o panel [` b`] [` item2`] usando el método rdiv() - 0 0.909091 1 9.756098 2 0.030030 3 0.960867 4 0.082521 dtype: float64