Comments (2)
Alright, so I wrote a python script for the first one that doesn't use the API, the reason being that the objects returned by the GET responses don't seem to allow collections of moves/pokemon. Ultimately chaining these requests together would be optimal to find outputs that are unique to specially-trained teams. I still use the _CSV_ files, however, as they and pandas were key to this script.
import pandas as pd
# retrieve move ids from crit rates
a = open('move_meta.csv')
av = pd.read_csv(a)
av = av[['move_id','crit_rate']]
av = av[(av['crit_rate'] > 0)]
av = av['move_id'].tolist()
# retrieve move id from move identifier
b = open('moves.csv')
bv = pd.read_csv(b)
fz = bv
bv = bv[['id','identifier']]
bv = bv[(bv['identifier'] == 'skill-swap')]
bv = bv['id'].tolist()
# retrieve pokemon id from move id
c = open('pokemon_moves.csv')
cv = pd.read_csv(c)
cv = cv[['pokemon_id','move_id']]
cv = cv[(cv['move_id'] == bv)]
cv = cv.drop_duplicates(cols='pokemon_id')
cv = cv['pokemon_id'].tolist()
# retrieve pokemon ids from move ids
d = open('pokemon_moves.csv')
dv = pd.read_csv(d)
dv = dv[['pokemon_id','move_id']]
dv = dv[(dv['move_id'].isin(av))]
# retrieve pokemon that know skill swap as well
dv = dv[(dv['pokemon_id'].isin(cv))]
dv = dv.drop_duplicates(cols=['pokemon_id', 'move_id'])
# retrieve pokemon identifiers and move identifiers
# first pokemon identifiers
e = open('pokemon.csv')
ey = pd.read_csv(e)
ey = ey[['id','identifier']]
ey = ey.set_index('id')['identifier'].to_dict()
ey = dv.replace({'pokemon_id': ey})
# second move identifiers
fz = fz[['id','identifier']]
fz = fz.set_index('id')['identifier'].to_dict()
fz = ey.replace({'move_id': fz})
final = fz
final.columns = ['Pokemon','Move']
final = final.set_index('Pokemon')
final.to_html('finalfile.html')
print final
# print fz
# print ey
# print dv
# print dv
# print cv
# print bv
# print av
from pokeapi.
Sorry No one has ever gotten back to you on this issue. Honestly I've looked over what you've posted and I'm not 100% sure exactly what your issue is. Is this still something concerning you? I'd like to help if I can
from pokeapi.
Related Issues (20)
- Dual normal-types displaying normal-type as ability HOT 1
- GraphQL api is down HOT 3
- Add pokemon cries to GraphqQL response HOT 1
- move effect prose 1 and 104 are the same HOT 3
- Why isnt csv a submodule just like sprites and cries? HOT 2
- Pokemons rename in species request HOT 2
- Problem with item flag countable HOT 4
- Link up --physical and --special Z moves to complete their data HOT 1
- Eevee's gender differences HOT 5
- Feature Request: Show if a pokemon in Nintendo Switch games can be transfered from Pokemon Home HOT 1
- Brambleghast missing Egg moves HOT 3
- Burmy cloaks
- Egg Cycles HOT 4
- Maximum and Minimum of Stats HOT 2
- SyntaxError: JSON.parse HOT 4
- Missing documentation for unnamed API resources HOT 4
- Implement API for fetching type name label sprites
- Vivillon Icy Snow Image Incorrect HOT 1
- Unable to distinguish Meowth form-specific evolutions
- Missing Alcremie Forms and Images
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 pokeapi.