Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

I want to add a new column to the DataFrame containing only the month of the measurement

In [11]: air_quality["month"] = air_quality["datetime"].dt.month

In [12]: air_quality.head()
Out[12]: 
    city country                  datetime location parameter  value   unit  month
0  Paris      FR 2019-06-21 00:00:00+00:00  FR04014       no2   20.0  µg/m³      6
1  Paris      FR 2019-06-20 23:00:00+00:00  FR04014       no2   21.8  µg/m³      6
2  Paris      FR 2019-06-20 22:00:00+00:00  FR04014       no2   26.5  µg/m³      6
3  Paris      FR 2019-06-20 21:00:00+00:00  FR04014       no2   24.9  µg/m³      6
4  Paris      FR 2019-06-20 20:00:00+00:00  FR04014       no2   21.4  µg/m³      6
Comment

PREVIOUS NEXT
Code Example
Python :: dbscan multidimensional data 
Python :: ticklabels are not centered heatmap 
Python :: python min date from dictionary 
Python :: REMOVE ALL ROWS FROM DATFRAME WGICH HAS DATA OLDER THAN 3 MONTHS PANDAS 
Python :: django how to create superuser if does not exists on migration 
Python :: bar plot with patterns colors 
Python :: tuple merging 
Python :: DiscordUtils 
Python :: cant import flask mail 
Python :: revit dynamo select all categories 
Python :: java to python code conversion 
Python :: delete all historical data django simple history 
Python :: convert json file to dict - if comming as list 
Python :: pip install rejson 
Python :: google video processor python nmp 
Python :: pandas exploring dataframe 
Python :: python socket set title 
Python :: how to take input a matrix using map in python 
Python :: fibonacci series stackoverflow 
Python :: Univariant Variable Analysis - Multiple Plots 
Python :: Custom RGB To Hex Conversion with Python 
Python :: permutation test python 
Python :: set focus in last position entry tkinter 
Python :: np.ptp 
Python :: symmetric_difference_update() Function of sets in python 
Python :: how to package a python library 
Python :: python yield async await thread function 
Python :: how to get total seconds in django queryset for timedelta field 
Python :: Python script to do something at the same time every day 
Python :: how to find most occurring items in sequence python 
ADD CONTENT
Topic
Content
Source link
Name
8+2 =