You can use the to_pydatetime method to be more explicit:
In [11]: ts = pd.Timestamp('2014-01-23 00:00:00', tz=None) In [12]: ts.to_pydatetime() Out[12]: datetime.datetime(2014, 1, 23, 0, 0)
It’s also available on a DatetimeIndex:
In [13]: rng = pd.date_range('1/10/2011', periods=3, freq='D') In [14]: rng.to_pydatetime() Out[14]: array([datetime.datetime(2011, 1, 10, 0, 0), datetime.datetime(2011, 1, 11, 0, 0), datetime.datetime(2011, 1, 12, 0, 0)], dtype=object)
Related Posts:
- Convenient way to deal with ValueError: cannot reindex from a duplicate axis
- How to convert string to datetime format in pandas python?
- datetime to string with series in pandas
- Convert Pandas Column to DateTime
- Renaming column names in Pandas
- Delete a column from a Pandas DataFrame
- Truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all()
- Writing a pandas DataFrame to CSV file
- Adding new column to existing DataFrame in Python pandas
- Modifing data while using iterrows() does not work
- How to change the order of DataFrame columns?
- What does `ValueError: cannot reindex from a duplicate axis` mean?
- Pandas DataFrame Groupby two columns and get counts
- How to show all columns’ names on a large pandas dataframe?
- ValueError: Unknown label type: ‘continuous’
- How to fix IndexError: invalid index to scalar variable
- How to deal with SettingWithCopyWarning in Pandas
- ImportError: No module named pandas
- Create a Pandas Dataframe by appending one row at a time
- How do I select rows from a DataFrame based on column values?
- How do I get the row count of a Pandas DataFrame?
- Python Pandas Counting the Occurrences of a Specific value
- Convert pandas dataframe to NumPy array
- Count unique values per groups with Pandas
- Convert pandas Series to DataFrame
- Error:cannot convert float NaN to integer in pandas
- Replacing column values in a pandas DataFrame
- How do I get the row count of a Pandas DataFrame?
- Pandas “Can only compare identically-labeled DataFrame objects” error
- Pandas: ValueError: cannot convert float NaN to integer
- Get list from pandas dataframe column or row?
- ValueError: Length of values does not match length of index | Pandas DataFrame.unique()
- ‘DataFrame’ object has no attribute ‘sort’
- ‘DataFrame’ object has no attribute ‘sort’
- TypeError: cannot unpack non-iterable int objec
- Pandas DataFrame column to list
- Rename Pandas DataFrame Index
- Why do I get: “Length of values does not match length of index” error?
- why should I make a copy of a data frame in pandas
- Pandas, merging two dataframes on multiple columns, and multiplying result
- Convert DataFrame column type from string to datetime, dd/mm/yyyy format
- How to customize a scatter matrix to see all titles?
- Get a list from Pandas DataFrame column headers
- What is dtype(‘O’), in pandas?
- Python TypeError: cannot convert the series to
when trying to do math on dataframe - Shuffle DataFrame rows
- How to take column-slices of dataframe in pandas
- Group by index + column in pandas
- Normalize data in pandas
- How to iterate over columns of pandas dataframe to run regression
- JSON to pandas DataFrame
- Convert a Pandas DataFrame to a dictionary
- Create a Pandas Dataframe by appending one row at a time
- Modify the legend of pandas bar plot
- Count unique values using pandas groupby
- Ignoring NaNs with str.containsv
- Count unique values per groups with Pandas [duplicate]
- Map to List error: Series object not callable
- Pandas DataFrame: replace all values in a column, based on condition
- No numeric types to aggregate – change in groupby() behaviour?
- Convert date to datetime in Python
- How do I get the day of week given a date?
- Pandas – How to flatten a hierarchical index in columns
- Pandas OR statement ending in series contains
- Solution for SpecificationError: nested renamer is not supported while agg() along with groupby()
- ValueError: Expected object or value when reading json as pandas dataframe
- How to check if a column exists in Pandas
- How to get a value from a cell of a dataframe?
- Pandas split DataFrame by column value
- Groupby value counts on the dataframe pandas
- Pandas – Drop function error (label not contained in axis)
- Pandas index column title or name
- Building multi-regression model throws error: `Pandas data cast to numpy dtype of object. Check input data with np.asarray(data).`
- import pandas_datareader gives ImportError: cannot import name ‘is_list_like’
- How to add pandas data to an existing csv file?
- Importing Pandas gives error AttributeError: module ‘pandas’ has no attribute ‘core’ in iPython Notebook
- Find the unique values in a column and then sort them
- pandas groupby sort within groups
- if else function in pandas dataframe
- cannot convert the series to
- Read data (.dat file) with Pandas
- How to convert index of a pandas dataframe into a column
- Replacing Pandas or Numpy Nan with a None to use with MysqlDB
- pandas replace multiple values one column
- Boolean Series key will be reindexed to match DataFrame index
- Converting Pandas dataframe into Spark dataframe error
- Convert floats to ints in Pandas?
- pandas comparison raises TypeError: cannot compare a dtyped [float64] array with a scalar of type [bool]
- How do I calculate the date six months from the current date using the datetime Python module?
- Difference between data type ‘datetime64[ns]’ and ‘
- Merging two DataFrames
- pandas: multiple conditions while indexing data frame – unexpected behavior
- Extract first and last row of a dataframe in pandas
- Logical operators for Boolean indexing in Pandas
- How to update Pandas from Anaconda and is it possible to use eclipse with this last
- vectorize conditional assignment in pandas dataframe
- Error in Reading a csv file in pandas[CParserError: Error tokenizing data. C error: Buffer overflow caught – possible malformed input file.]
- Extracting specific selected columns to new DataFrame as a copy
- How can I convert a datetime object to milliseconds since epoch (unix time) in Python?
- Compare two columns using pandas