pwwang / datar

A Grammar of Data Manipulation in python

Home Page:https://pwwang.github.io/datar/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

AttributeError: '_io.TextIOWrapper' object has no attribute

antonio-yu opened this issue · comments

I installed datar in another remote server .
Some errors occoured:

from datar.all import * 
from datar.datasets import mtcars 
datar >> count(f.gear)

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-25-4bc0873b22a1> in <module>
      1 from datar.datasets import mtcars
----> 2 datar >> count(f.gear)

AttributeError: '_io.TextIOWrapper' object has no attribute 'gear'
datar.get_versions()
python   : 3.8.10 | packaged by conda-forge | (default, May 11 2021, 07:01:05) 
           [GCC 9.3.0]
datar    : 0.9.1
numpy    : 1.20.3
pipda    : 0.8.2
executing: 1.2.0
pandas   : 1.4.2

Other functions like 'mutate','select' work well.
It seems that 'group by ' has a problem.

Should be mtcars >> ...

I found out where the error came from .

when reading txt file, the variable was name as f :

open('train.txt','r',encoding='utf-8') as f: