neoanalytix 0.1.0
Python client for NeoAnalytix data analysis platform
Requires Python: >=3.8

# Intro

NeoAnalytix is a natural language data analysis and visualization Python package that provides an intuitive interface for data manipulation, statistical analysis, and visualization. Simply describe what you want to do in plain English, and NeoAnalytix will handle the technical implementation. It currently supports 4 datatype patterns: numeric,categorical,date/datetime/timestamp,geospatial(experimental).


Demo dataset link: https://www.kaggle.com/datasets/warcoder/earthquake-dataset


## Installation

```bash
pip install neoanalytix
```

## Quick Start

```python
>>> from neoanalytix import Neo
>>> neo = Neo()
```

## AUTHENTICATION

```python
>>> neo.auth.signup()
>>> neo.auth.login()
>>> neo.auth.logout()
```

## DATA UPLOAD

```python
>>> _ = neo.upload_csv("YOUR_CSVFILE_PATH")
```

## DATA SELECTOR

supports these query patterns in plain English : 
    
    List all csvs, Get the current active csv, Set data.csv as active
    Delete one or more csvs, Read metadata for a specific csv,
    Update metadata for a specific csv

```python
>>> neo.data_selector("List all csvs")
```

## ================================================DATA ANALYSIS===================================================

OPERATIONS SUPPORTED -  Cleaning, Inspection, Transformation, General Statistics,Window and Rolling operations, Groupby with Statistical aggregation, Arithmetic operations

API -> neo.analytix(query)
Dataset -> https://www.kaggle.com/datasets/warcoder/earthquake-dataset

### ------------DATA INSPECTION-----------

"show first m rows","show last n rows" ,"show random sample" ,"get dataframe info","show summary statistics", "analyze null values" ,"correlation analysis"

```python
>>> neo.analytix("show me random 10 rows")
```

### ------------DATA CLEANING-----------

for "numeric" datatype columns : fill_constant,fill_mean, fill_median,fill_mode
    drop_outliers_zscore( Remove outliers using Z-score),
    drop_outliers_iqr(Remove outliers using IQR method),
    enforce_range: Clip values to min/max range (requires "min_value" and/or "max_value" as numbers)


```python
>>> neo.analytix("Enforce magnitude between 0-10")
>>> neo.analytix("fill magnitude with mean")
```

for categorical datatype columns : categorical_fill_constant, categorical_fill_mode,
    categorical_map_values: Map specific values to new values (requires "mapping" parameter as dict)
    categorical_filter_invalid: Keep only valid values (requires "valid_values" parameter as LIST of strings)
    categorical_compress_rare: Group rare categories into "other" (requires "min_count" as number, "other_label" as string)

```python
>>> neo.analytix("fill magnitude type with mode")
```

for datetime datatype columns : datetime_fill_constant, datetime_fix_invalid,
    datetime_remove_out_of_range( Remove dates outside range (requires "min_dt"/"max_dt" as strings))
    datetime_drop_duplicates: Remove duplicate dates

```python
>>> neo.analytix("Remove earthquake dates before 1900 or after 2026")
```

for geospatial datatype columns : geo_fix_latlong_range, geo_swap_latlong_if_reversed, geo_drop_duplicates

```python
>>> neo.analytix("Fix latitude range: invalid latitudes (outside -90 to 90) to NULL")
```



### ------------ DATA TRANSFORMATION -----------

for numeric datatype columns: standardize,minmax_scale,log_transform,       
    sqrt_transform,polynomial_features,interaction_terms


```python
>>> neo.analytix("Apply z-score standardization to depth measurements")
```

for categorical datatype columns: one_hot_encode, label_encode, frequency_encode,
            "target_encode", "categorical_binarize",

```python
>>> neo.analytix("Create one-hot encoding for the 'magType' column")
```

for datetime datatype columns:  "datetime_cyclical_encode",

```python
>>> neo.analytix("Apply cyclical encoding to day of week from earthquake time")
```

for geospatial datatype columns:  "geo_create_buffer", "geo_simplify_geometry"

```python
>>> neo.analytix("Create a 50km buffer zone around each earthquake epicenter")
```

### ------------GENERAL STATISTICS-----------

for numeric columns: count, sum, min, max, mean,median, mode, prod, unique, nunique,
    value_counts, std, var, sem, mad,iqr, range, skew, kurtosis, entropy,quantile, percentile, corr, corr_spearman,
    corr_kendall, cov, autocorr

```python
>>> neo.analytix("Calculate the mean, median, and standard deviation of the 'magnitude' column")
```

for categorical columns:  count, unique, nunique, value_counts, mode, proportions,crosstab,contingency_table

```python
>>> neo.analytix("Show the frequency distribution of the 'magType' column")
```
        
for datetime columns:min, max, count, nunique, diff,delta_stats, event_rate, time_unit_counts, weekday_weekend_counts, holiday_counts

```python
>>> neo.analytix("Calculate event rate per month for earthquakes")
```

for geospatial columns:"geospatial_count", "geospatial_length_stats", "geospatial_distance_stats", "geospatial_hotspot_statistics", ,

```python
>>> neo.analytix("Calculate distance statistics to equator (ref_lat: 0, ref_lon: 0)")
```

### ------------WINDOW AND ROLLING OPERATIONS----------- 

for numeric columns: cumsum, cumprod, cummax, cummin, cummean, cumcount, cumstd, cumvar,
rolling_sum, rolling_mean, rolling_min, rolling_max, rolling_std, rolling_var, rolling_skew, rolling_kurtosis, rolling_corr, rolling_cov, rolling_autocorr, expanding_sum, expanding_mean, expanding_min, expanding_max, expanding_std, expanding_var, expanding_skew, expanding_kurtosis, expanding_corr, expanding_cov, expanding_autocorr,ewm

```python
>>> neo.analytix("Calculate the rolling mean of the 'magnitude' column with a window of 5")
```

```python
_ = neo.analytix("Calculate cumulative standard deviation of magnitude ordered by earthquake time")
```

```python
_ = neo.analytix("Calculate rolling 75th percentile of magnitude error (magError) with 10-event window")
```

```python
_ = neo.analytix("Compute EWM of magnitude error (magError) with alpha=0.7 ordered by earthquake ID",)
```

for categorical columns: cumcounts, cummode, cumcount,rolling_count, rolling_unique, rolling_mode, rolling_entropy,expanding_count, expanding_unique, expanding_mode,categorical_diff

```python
_ = neo.analytix("Generate rolling count of earthquakes in last 30 days",)
```

for datetime columns: cumulative_count,diff_summary,rolling_count, expanding,lag_lead

```python
_ = neo.analytix("Create lag and lead columns for earthquake times",)
```

for geospatial columns: point_lag_distance, cumulative_distance, rolling_distance, expanding_distance,speed, diff,rolling_density,
rolling_centroid_shift

```python
_ = neo.analytix("Compute cumulative distance in rolling 20-event window")
```

### -------------- ARITHMETIC OPERATIONS ------------- 

for numeric columns:add, subtract, multiply, divide, mod, power,abs, neg, round, ceil, floor, trunc,clip_lower, clip_upper, clip,exp, log, log10, sqrt,sin, cos, tan, asin, acos, atan, atan2,weighted_average, percentage_change, normalize_range


```python
_ = neo.analytix("Subtract depth error from depth to get corrected depth estimate",)
```

```python
_ = neo.analytix("Natural log of number of stations (nst) for station count normalization",)
```

### ------------GROUPBY WITH STATISTICAL AGGREGATION----------- 

for numeric columns: groupby_count,groupby_sum,groupby_min,groupby_max,groupby_mean,groupby_median,groupby_std,groupby_var,groupby_mode,groupby_nunique,groupby_quantile,groupby_basic_summary

```python
_ = neo.analytix("What's the average magnitude for each earthquake type?")
```

```python
_ = neo.analytix("Average depth error when grouping by both earthquake year AND earthquake type")
```

for categorical columns: groupby_count,groupby_nunique,groupby_value_counts,groupby_mode, groupby_proportions

```python
_ = neo.analytix("What are the most common magnitude values (mode) by earthquake type?")
```

for datetime columns: groupby_min,groupby_max,groupby_count,groupby_nunique,groupby_time_unit_counts,groupby_weekday_weekend_counts,groupby_multi_aggregation

for geospatial columns: groupby_geospatial_count,groupby_geospatial_area_stats,groupby_geospatial_length_stats,groupby_geospatial_distance_stats,groupby_geospatial_geometry_type_counts,groupby_geospatial_density_analysis

```python
_ = neo.analytix("What's the average distance from the equator for each magnitude type? Use reference point (0,0)",)
```

### --------------GROUPBY WITH WINDOW AGGREGATION------------- 

for numeric columns:groupby_window_cumsum,groupby_window_cummax,groupby_window_cummin,groupby_window_cummean, groupby_window_cumstd,groupby_window_cumvar,groupby_window_rolling_sum,groupby_window_rolling_avg,groupby_window_rolling_min,groupby_window_rolling_max,groupby_window_rolling_diff,groupby_window_rolling_pct_change,groupby_window_rolling_std, groupby_window_rolling_var

```python
_ = neo.analytix("Show rolling 10-earthquake sum of horizontal error per region, magnitude type, and earthquake status.",)
```


for categorical columns:  "groupby_window_cumcount","groupby_window_cummode","groupby_window_rolling_count",  "groupby_window_rolling_unique","groupby_window_rolling_mode","groupby_window_rolling_entropy","groupby_window_expanding_count", "groupby_window_expanding_unique",
            "groupby_window_expanding_mode",


```python
_ = neo.analytix("What is the expanding count of earthquakes per region and magType over time?",)
```


for geospatial columns: groupby_window_lag_distance, groupby_window_cumulative_distance,groupby_window_rolling_distance, groupby_window_speed, groupby_window_rolling_variance, groupby_window_multi_aggregation

```python
_ = neo.analytix("Calculate cumulative distance between earthquake epicenters based on latitude/longitude for each region")
```

### -----------------FILTERING-----------------

for numeric columns: gt, gte, lt, lte, eq, ne, between, outside, gt_col, lt_col,
delta_gt

```python
_ = neo.analytix("Filter for earthquakes with magnitude greater than 5.0")
```


for categorical columns:eq, ne, in, not_in,contains, starts_with, ends_with,
ilike, regex, not_regex, is_null, not_null, length_gt, length_lt, length_eq

```python
_ = neo.analytix("Show earthquakes where earthquake type is in ['earthquake', 'explosion'] ")
```

for datetime columns: before, after, on_or_before, on_or_after, eq, ne, between, outside, last_days, last_hours, last_minutes, last_months, last_years,
year_eq, month_eq, day_eq, hour_eq, minute_eq, second_eq,month_between, hour_between, day_between, is_weekday, is_weekend, is_monday, is_friday, dow_eq,
is_business_hours, is_off_hours

```python
_ = neo.analytix("Filter earthquakes between '2026-01-01' and '2026-01-31'")
```

for geospatial columns:within, contains, intersects, touches, crosses, overlaps, disjoint, equals, distance_within, distance_beyond, distance_within_km, distance_beyond_km, distance_in_km, bbox_intersects, within_city, within_country,near_landmark, near_road, in_zone


```python
_ = neo.analytix("Find all earthquakes within 50 km of the equator (0,0)")
```

## ========================================== DATA VIZUALIZATION ==================================================

Visualisation Supported - BAR, PIE, SUNBURST, RADAR, TREEMAP, BOX, VIOLIN, HEATMAP, DIST, HISTOGRAM, LINE, SCATTER, CANDLESTICK, OHLC

CHOROPLETH(coming soon...)

API -> neo.viz(query)
Dataset -> https://www.kaggle.com/datasets/tunguz/data-on-covid19-coronavirus

### ----------------- BAR -----------------

```python
_ = neo.viz("Create bar plot: average new_cases by continent")
```

### ----------------- PIE -----------------

```python
_ = neo.viz("Show the distribution of records by year as a pie chart")
```
### ----------------- SUNBURST -----------------

```python
_ = neo.viz("Generate hierarchical sunburst: location → tests_units type")
```

### ----------------- TREEMAP -----------------

```python
_ = neo.viz("Create treemap: sum of new_cases by continent")
```

### ----------------- RADAR -----------------

```python
_ = neo.viz("Create radar chart: total_tests vs population averages")
```

### ----------------- BOX -----------------

```python
_ = neo.viz("Show box plot of new_cases_per_million.")
```

### ----------------- VIOLIN -----------------

```python
_ = neo.viz("Show a violin plot of the distribution of daily_new_cases")
```

### ----------------- DIST -----------------

```python
_ = neo.viz("Dist Plot :whats the distribution of reproduction_rate for each continent.",
)
```

### ----------------- HISTOGRAM -----------------

```python
_ = neo.viz("Plot a histogram of new_cases_per_million")
```

### ----------------- SCATTER -----------------

```python
_ = neo.viz("Scatter plot of new_cases vs new_deaths")
```

### ----------------- LINE -----------------

```python
_ = neo.viz("Show total_cases over date as a line chart")
```

### ----------------- HEATMAP -----------------

```python
_ = neo.viz("Create a heatmap showing new_cases trends over time by date")
```

### ----------------- CANDLESTICK -----------------

```python
_ = neo.viz("Create a candlestick chart showing open, high, low, close prices over time")
```
### ----------------- OHLC -----------------

```python
_ = neo.viz("Plot OHLC with both SMA_20 and SMA_50 indicators calculated from close column")
```