Comments (4)
Hey @ChinCity, it looks quiet good. I think you have to pull the convert_alpha2_to_country
line to the top before the country filtering.
Or probably the line
.loc[lambda df: df.Country.isin(config['target_countries'])]
can be deleted as the config_filter should take care of this.
from powerplantmatching.
Hey @FabianHofmann,
I tried both of those but I'm still getting an empty dataframe :/
from powerplantmatching.
Have you checked if your raw file is properly loaded? If yes, I would go step by step through the lines and check where the entries are dropped (atm it seems only the config filter could do so)
from powerplantmatching.
You are right that did it!
Final code:
config = get_config() if config is None else config
change_fueltype={'Fossil Gas': 'Natural Gas',
'Fossil Coal-derived gas': 'Natural Gas',
'Hydro Run-of-river and poundage': 'Hydro',
'Hydro Pumped Storage': 'Hydro',
'Hydro Water Reservoir': 'Hydro',
'Fossil Hard coal': 'Hard Coal',
'Fossil Hard Coal': 'Hard Coal',
'Fossil Brown coal/Lignite': 'Lignite',
'Fossil Oil': 'Oil',
'Fossil Oil shale': 'Oil',
'Wind Offshore': 'Wind',
'Wind Onshore': 'Wind',
'Biomass': 'Bioenergy',
'Fossil Peat': 'Bioenergy',
'Marine': 'Other'}
df = parse_if_not_stored('JRC_OPEN_update', update, config)
if raw:
return df
df = (df.rename(columns={'eic_p': 'projectID',
'name_p': 'Name',
'capacity_p': 'Capacity',
'country': 'Country',
'type_g': 'Fueltype',
'lat': 'lat',
'lon': 'lon',
'year_commissioned':'YearCommissioned'})
.loc[lambda df: df.Country.isin(config['target_countries'])]
.replace(change_fueltype)
.drop(columns = ['eic_g', 'name_g', 'capacity_g', 'NUTS2',
'status_g', 'year_decommissioned', 'type_g2'])
.pipe(set_column_name, 'JRC_OPEN_update'))
return df
from powerplantmatching.
Related Issues (20)
- Problems when no values are parsed for DataIn in datasets HOT 3
- Add info if datasets are not freshly loaded HOT 5
- Add Climate Trace
- CI: also test windows and macos?
- Add globalenergyobservatory data HOT 1
- Undocumented dependency (java)
- Set not correctly assigned
- Improve final dataset creation
- AttributeError: 'DataFrame' object has no attribute 'Name HOT 8
- The system cannot find the file specified, when aggregating HOT 2
- Using powerplantmatching for a new dataset HOT 1
- Problem with some power plants start year (DateIn) HOT 2
- PHS capacity HOT 6
- GEO and GPD links leading to bad gateway HOT 3
- Dataset GEM_GGPT not working HOT 1
- Add GEM coal plan data
- Add GEM geothermal data HOT 1
- Bug keyerror in hash code
- Release new version? HOT 3
- Harmonize country conversion HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from powerplantmatching.