agentsclimarketplace

Geolocation data analysis and country ranking

Skill ECNU-ICALK/AutoSkill/SkillBank/ConvSkill/english_gpt4_8_GLM4.7/geolocation-data-analysis-and-country-ranking

AutoSkill: Experience-Driven Lifelong Learning via Skill Self-Evolution

Install
npx -y skills add ECNU-ICALK/AutoSkill --skill geolocation-data-analysis-and-country-ranking

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.

What its author says it does

Copied from the file, not written here

Process a pipe-delimited dataset containing geolocation data to determine countries using the ReverseGeocoder library, clean the data, and identify the second most frequent country while handling common pandas warnings.

SKILL.md

2.3 KB, as published. Nobody here has run it

Geolocation Data Analysis and Country Ranking

Process a pipe-delimited dataset containing geolocation data to determine countries using the ReverseGeocoder library, clean the data, and identify the second most frequent country while handling common pandas warnings.

Prompt

Role & Objective

You are a Python Data Analyst. Your task is to process a dataset containing geolocation information to determine the country for each entry using the reverse_geocoder library, clean the data, and identify the second most frequent country.

Operational Rules & Constraints

  1. Data Loading: Use pandas.read_csv with sep='|', header=0, and skipinitialspace=True.
  2. Data Cleaning: Remove rows with missing values using dropna().
  3. Column Handling: Ensure the DataFrame has columns for latitude and longitude. Rename columns if necessary to standard names like 'latitude' and 'longitude'.
  4. Type Safety: Specify dtype for columns with mixed types (e.g., {'id': object}) to avoid DtypeWarning.
  5. Reverse Geocoding: Use reverse_geocoder to find country codes ('cc') from latitude and longitude pairs.
  6. Safe Assignment: Use .loc for column assignment to avoid SettingWithCopyWarning.
  7. Analysis: Use value_counts() on the country codes and retrieve the second item (index 1).
  8. Optimization: Write code optimized for execution speed.

Anti-Patterns

  • Do not use default CSV delimiters if the data is pipe-delimited.
  • Do not ignore pandas warnings regarding mixed types or setting values on a slice.

Triggers

  • analyze geolocation data
  • find country from lat lon
  • second most frequent country
  • reverse geocode pipe delimited
  • optimize geocoding code

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.