All my files are in a same directory
I'm fresh in python and I'm trying to code functions in a Preprocessing file like this:
#Preprocessing file
from dateutil import parser
def dropOutcomeSubtype(DataFrame):
DataFrame.drop('OutcomeSubtype',axis=1,inplace='True')
def convertTimestampToTime(Serie):
for i in range(0,len(Serie)):
parser.parse(Serie[i]).time()
And then I'm trying to use it in a Exporting file like this:
#Import external librairies
import pandas as pd
import numpy as np
import re
#import our librairy
from Preprocessing import convertTimestampToTime, dropOutcomeSubtype
#Reading
Datas = pd.read_csv("../Csv/train.csv", sep=",", na_values=['NaN'])
dropOutcomeSubtype(Datas)
convertTimestampToTime(Datas.DateTime)
And when i try to run the code in my OSX shell with this config: Python 3.5.2 |Anaconda 4.2.0 (x86_64)| IPython 5.1.0
I have get this error: cannot import name 'convertTimestampToTime'
and if change my import statement like this:
from Preprocessing import *
I get this error: name 'convertTimestampToTime' is not defined
Can you explain me why please ?
Thank you in advance