Skip to content

Error in twitter_app.py #9

@gmrwvu

Description

@gmrwvu

I received this error when attempting to run the twitter_app.py script:

C:\Users\gmrwv\PycharmProjects\my-first-app\venv\Scripts\python.exe C:\gmrPy\twitter_app.py
Traceback (most recent call last):
File "C:\gmrPy\twitter_app.py", line 10, in
df["date_time"] = pd.to_datetime(df["date_time"])
File "C:\Users\gmrwv\PycharmProjects\my-first-app\venv\lib\site-packages\pandas\core\tools\datetimes.py", line 1050, in to_datetime
values = convert_listlike(arg._values, format)
File "C:\Users\gmrwv\PycharmProjects\my-first-app\venv\lib\site-packages\pandas\core\tools\datetimes.py", line 453, in _convert_listlike_datetimes
return _array_strptime_with_fallback(arg, name, utc, format, exact, errors)
File "C:\Users\gmrwv\PycharmProjects\my-first-app\venv\lib\site-packages\pandas\core\tools\datetimes.py", line 484, in _array_strptime_with_fallback
result, timezones = array_strptime(arg, fmt, exact=exact, errors=errors, utc=utc)
File "pandas_libs\tslibs\strptime.pyx", line 530, in pandas._libs.tslibs.strptime.array_strptime
File "pandas_libs\tslibs\strptime.pyx", line 351, in pandas._libs.tslibs.strptime.array_strptime
ValueError: time data "27/12/2016 04:04" doesn't match format "%m/%d/%Y %H:%M", at position 9. You might want to try:
- passing format if your strings have a consistent format;
- passing format='ISO8601' if your strings are all ISO8601 but not necessarily in exactly the same format;
- passing format='mixed', and the format will be inferred for each element individually. You might want to use dayfirst alongside this.

Process finished with exit code 1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions