Is there a simple way to ignore all even/odd rows when reading a csv using pandas
?
I know skiprows
argument in pd.read_csv
but for that I'll need to know the number of rows in advance.
The pd.read_csv
skiprows
argument accepts a callable, so you could use a lambda function. E.g.:
df = pd.read_csv(some_path, skiprows=lambda x: x%2 == 0)
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다