Код: Выделить всё
roundКод: Выделить всё
round([1.345, 2.718], 2) # Raises TypeError
Код: Выделить всё
roundКод: Выделить всё
import numpy as np
round(np.array([1.345, 2.718]), 2) # Raises TypeError
Код: Выделить всё
import pandas as pd
round(pd.Series([1.345, 2.718]), 2) # Works just fine
Подробнее здесь: https://stackoverflow.com/questions/790 ... ith-pandas