Skip to content
Snippets Groups Projects
Commit fc0b6e8c authored by Sergei Panarin's avatar Sergei Panarin
Browse files

Fixed reading faulty inputs from file date column, convert them to NaN instead...

Fixed reading faulty inputs from file date column, convert them to NaN instead and then edit them out of dataframe
parent 070fe8c7
No related branches found
No related tags found
No related merge requests found
...@@ -67,7 +67,7 @@ def genre_data_aggregation(data, interval): ...@@ -67,7 +67,7 @@ def genre_data_aggregation(data, interval):
data["genres"] = data["genres"].apply(lambda x: str(x).split(",")) data["genres"] = data["genres"].apply(lambda x: str(x).split(","))
# preprocess the release date column into the pandas datetime format # preprocess the release date column into the pandas datetime format
data['release_date'] = pd.to_datetime(data['release_date'], dayfirst=True, format="mixed") data['release_date'] = pd.to_datetime(data['release_date'], dayfirst=True, format="mixed", errors='coerce')
# remove whitespaces # remove whitespaces
data['genres'] = data['genres'].map(lambda x: list(map(str.strip, x))) data['genres'] = data['genres'].map(lambda x: list(map(str.strip, x)))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment