On 2015/11/22 8:04 PM, Aastha wrote:
> Hi,
>
> I am trying to compare to compare three columns max, min , exp_year in
> my csv file. I am using dataframe for this and trying to to check if
> min<=exp_year<= max, a new column should be added with corresponding
> value true else false. But m getting following error :
>
> module 'pandas' has no attribute 'Dataframe'
It's case-sensitive: DataFrame.
>
>
> Below is my code :
>
> from pandas import DataFrame, read_csv
> import matplotlib.pyplot as plt
> import pandas as pd
>
> %matplotlib inline
> df = pd.read_csv("C:\\Users\\ssl\\Desktop\\train.csv", header=None)
> df =
> pd.read_csv("C:\\Users\\ssl\\Desktop\\train.csv",names=['min','max','exp_year','exp_month','ratio'],header=None)
> #pd.read_csv(StringIO(data), usecols=['min', 'exp_year','max'])
> print(df)
>
The line below is the problem.
> df['f1']=pd.Dataframe(df['min'] <= df['exp_year'] and df['exp_year'] <=
Eric