문제

What's wrong here?

import pandas as pd
import numpy as np
ts = pd.Series(randint(0, 500, len(rng)), index=rng)

Gives: TypeError: randint() takes exactly 3 arguments (4 given)

System: Python 2.7.5+ Pandas 0.12.0-2ubuntu1

도움이 되었습니까?

해결책

Seems you randint comes from the standard library (random.randint)

Here are two ways to correct your code

  1. modify randint to np.random.randint

  2. add from numpy.random import randint

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top