The difference between one date value and another date value was taken
There is a column.
The contents are as follows. (There are many missing values, but)
8534 27 days 18:46:31
8548 156 days 07:19:25
Extract only date values (for example, 156 of 8548),
We want to delete other data.
So split (), days (), str.split () etc.
I tried it,
Neither series has that attribute
It was played because of that.
I tried reading the official series documentation, but
There wasn't much pinning.
Are there any good ways?Error message
Applicable source code
-------------------------------------------- ------------------------------- AttributeError Traceback (most recent call last) <ipython-input-40-47464bdb491a>in<module> 2 Y = df ['First contact (click time)'] 3 sub = X-Y ---->4 sub = pd.to_timedelta (sub, errors = 'coerce'). Days 5 df ['First Time ~ Check-in'] = sub 6 print (df ['First time ~ Check-in']) c: \ users \ 01037485 \ taishi \ lib \ site-packages \ pandas \ core \ generic.py in __getattr __ (self, name) 5177 if self._info_axis._can_hold_identifiers_and_holds_name (name): 5178 return self [name] ->5179 return object .__ getattribute __ (self, name) 5180 5181 def __setattr __ (self, name, value): AttributeError: 'Series' object has no attribute 'days'
X = df ['Check-in date'] Y = df ['First contact (click time)'] sub = X-Y sub = pd.to_timedelta (sub, errors = 'coerce'). days df ['first time ~ check-in'] = sub print (df ['first time ~ check-in'])
Answer # 1
df ['Initial Check-in']. dt.days
Answer # 2
You can get it with
- python - i want to know only one type of value
- python - matplotlib i want to draw a horizontal line
- python - i want to trim the detection area
- python - i want to read a csv file and output it
- i want to read a csv file with python numpy
- python 3x - i want to put input restrictions on the text box
- python 3x - i want to output print as one data to a file
- python - i want to import from config
- python - i want to modify the program
- python 3x - i want to focus out from a text box
- python 3x - i want the if statement to work
- python - i want to list the word count of sentences
- python - i want to remove the label!
- i want to make a button only with jquery
- css - i want to adapt it only on the box shadow
- python - i want to know how to use variables in driverexecute_script
- i want to make sure to delete /pyenv/shims/python
- i want to call jquery change only once
- python - i want to use opencv on raspberry pi
- python - i want to know why while is not working
- python - i want to create a new dataframe by repeating the work of extracting the average value of the dataframe
- python - i don't understand the indexing law of pandasseries i don't know how to take it out
- python - permissionerror: [errno 13] permission denied
- python - i get an error when connecting to a voice channel with discordpy
- python - i want to get the elements in the linked site
- error display on python discord bot
- python - i want to determine if the channel is a text channel
- i want to wait until the next process can be performed after executing the process in python
- python - [scipy-interpolate] i want to interpolate the time information and coordinate data into data every second
- i want to connect to 64-bit ms access from 32-bit python