anenglishgoat /
balaban
A small Python package for estimating & plotting Bayesian hierarchical models for player-level football data
65/100 healthLoading repository data…
modflowpy / repository
A Python package to create, run, and post-process MODFLOW-based models.
A transparent discovery signal based on current public GitHub metadata.
This score does not audit code, security, maintainers, documentation quality, or suitability. Verify the repository and its current documentation before adoption.
FloPy includes support for MODFLOW 6, MODFLOW-2005, MODFLOW-NWT, MODFLOW-USG, and MODFLOW-2000. Other supported MODFLOW-based models include MODPATH (version 6 and 7), MT3DMS, MT3D-USGS, and SEAWAT.
For general modeling issues, please consult a modeling forum, such as the MODFLOW Users Group. Other MODFLOW resources are listed in the MODFLOW Resources section.
FloPy requires Python 3.10+ with:
numpy >=1.20.3
matplotlib >=1.4.0
pandas >=2.0.0
Dependencies for optional features are summarized here.
To install type:
conda install -c conda-forge flopy
or
pip install flopy
The release candidate version can also be installed from the git repository using the instructions provided below.
After FloPy is installed, MODFLOW and related programs can be installed using the command:
get-modflow :
See the docs for more information.
import flopy
ws = './mymodel'
name = 'mymodel'
sim = flopy.mf6.MFSimulation(sim_name=name, sim_ws=ws, exe_name='mf6')
tdis = flopy.mf6.ModflowTdis(sim)
ims = flopy.mf6.ModflowIms(sim)
gwf = flopy.mf6.ModflowGwf(sim, modelname=name, save_flows=True)
dis = flopy.mf6.ModflowGwfdis(gwf, nrow=10, ncol=10)
ic = flopy.mf6.ModflowGwfic(gwf)
npf = flopy.mf6.ModflowGwfnpf(gwf, save_specific_discharge=True)
chd = flopy.mf6.ModflowGwfchd(gwf, stress_period_data=[[(0, 0, 0), 1.],
[(0, 9, 9), 0.]])
budget_file = name + '.bud'
head_file = name + '.hds'
oc = flopy.mf6.ModflowGwfoc(gwf,
budget_filerecord=budget_file,
head_filerecord=head_file,
saverecord=[('HEAD', 'ALL'), ('BUDGET', 'ALL')])
sim.write_simulation()
sim.run_simulation()
head = gwf.output.head().get_data()
bud = gwf.output.budget()
spdis = bud.get_data(text='DATA-SPDIS')[0]
qx, qy, qz = flopy.utils.postprocessing.get_specific_discharge(spdis, gwf)
pmv = flopy.plot.PlotMapView(gwf)
pmv.plot_array(head)
pmv.plot_grid(colors='white')
pmv.contour_array(head, levels=[.2, .4, .6, .8], linewidths=3.)
pmv.plot_vector(qx, qy, normalize=True, color="white")
FloPy tutorials and scripts demonstrating the use of FloPy to run and post-process MODFLOW-based models.
FloPy example notebooks demonstrating the use of FloPy pre- and post-processing capabilities with a variety of MODFLOW-based models.
MODFLOW 6 example problems demonstrating FloPy use to create, run, and post-process MODFLOW 6 models.
A list of supported packages in FloPy is available in docs/supported_packages.md on the github repo.
A table of the supported and proposed model checks implemented in FloPy is available in docs/model_checks.md on the github repo.
A summary of changes in each FloPy version is available in docs/version_changes.md on the github repo.
FloPy usage has been growing rapidly, and as the number of users has increased, so has the number of questions about how to use FloPy. We ask our users to carefully consider the nature of their problem and seek help in the appropriate manner.
Do not open issues for general support questions. We want to keep GitHub issues for bug reports and feature requests. General support questions are better answered in the Discussions on the FloPy GitHub repository. Stack Overflow and the MODFLOW google group are other options but currently neither of these are as active as Discussions on the FloPy GitHub repository. If using Stack Overflow, questions should be tagged with tag flopy.
To save your and our time, we will systematically close all issues that are requests for general support and redirect people to Stack Overflow or the MODFLOW google group.
Bug reports, code contributions, or improvements to the documentation are welcome from the community. See the developer docs to begin. Please also read up on our guidelines for contributing and check out our issues in the hotlist: community-help.
To install the latest release candidate type:
pip install https://github.com/modflowpy/flopy/zipball/develop
Selected from shared topics, language and repository description—not editorial ratings.
anenglishgoat /
A small Python package for estimating & plotting Bayesian hierarchical models for player-level football data
65/100 healthNikhilaThota /
Understand the relationships between various features in relation with the sale price of a house using exploratory data analysis and statistical analysis. Applied ML algorithms such as Multiple Linear Regression, Ridge Regression and Lasso Regression in combination with cross validation. Performed parameter tuning, compared the test scores and suggested a best model to predict the final sale price of a house. Seaborn is used to plot graphs and scikit learn package is used for statistical analysis.
45/100 healthsohilsshah91 /
This project gives an overview of crime time analysis in New York City . We have created Python Jupyter notebooks for spatial analysis of different crime types in the city using Pandas, Numpy, Plotly and Leaflet packages. As a second part to this analysis, we worked on ARIMA model on R for predicting the crime counts across various localities in the city based on correlations of various demographics correlation in each locality.
44/100 healthntotorica /
Author: Nathan Totorica Date: 5/14/2021 # Singularity Matrix Pertubation (SMP) This code was written for a class project in the course entitled ECE 504: "ST: Passive Electromagnetic Systems" taught in Spring 2021 by Dr. Ata Zadehgol at the University of Idaho in Moscow. This code was developed, in part, based on the code developed by Jennifer Houle in ECE 504 "ST: Modern Circuit Synthesis Algorithms" taught in Spring 2020 by Dr. Ata Zadehgol. Jennifer's code is available online at https://github.com/JenniferEHoule/Circuit_Synthesis. ## Overview Singular Matrix Perturbation (SMP) as introduced in [11], is a passivity enforcement algorithm for use on fitted models. This robust method is fast, computationally inexpensive, and accurate in enforcing passivity. This implementation using Python can easily be used with Vector Fitting algorithm implemented in [12]. Example cases to demonstrate passivity enforcmment were taken from [7][15], as well as custom examples designed in simulation software based off of multiport circuit synthesis as described in [6]. ## I/O and Flow Description - Instructions for input and output and flow description can be found in flow_diagram.pdf. ## Files - SMP.py: Singularity matrix perturbation implementation of [11] - s_compare.py: Compare ADS simulated S matrices. Calculate RMS error and plot - eig_plot.py: Plotting functions. Eigenvalue plots based off of plot.py in [12] - smp_ex.py: Example of how to pull .sp file in, parse parameters, send to vector fitting, enforce passivity, and generate new passive circuit. Imported from [12] - Ex2_y.py - vectfit3.py - intercheig.py - rot.py - pass_check.py - fitcalc.py - FRPY.py - intercheig.py - violextrema.py - plots.py - quadprog.py - pr2ss.py - utils.py ## Licensing GPL-3.0 License In addition to licensing: Embedding any of (or parts from) the routines of the Matrix Fitting Toolbox in a commercial software, or a software requiring licensing, is strictly prohibited. This applies to all routines, see Section 2.1. If the code is used in a scientific work, then reference should me made as follows: VFdriver.m and/or vectfit3.m: References [1],[2],[3] RPdriver.m and/or FRPY.m applied to Y-parameters: [8],[9] ## References [1] B. Gustavsen and A. Semlyen, "Rational approximation of frequency domain responses by Vector Fitting", IEEE Trans. Power Delivery, vol. 14, no. 3, pp. 1052-1061, July 1999. [2] B. Gustavsen, "Improving the pole relocating properties of vector fitting", IEEE Trans. Power Delivery, vol. 21, no. 3, pp. 1587-1592, July 2006. [3] D. Deschrijver, M. Mrozowski, T. Dhaene, and D. De Zutter, "Macromodeling of Multiport Systems Using a Fast Implementation of the Vector Fitting Method", IEEE Microwave and Wireless Components Letters, vol. 18, no. 6, pp. 383-385, June 2008. [4] B. Gustavsen, VFIT3, The Vector Fitting Website. March 20, 2013. Accessed on: Jan. 21, 2020. [Online]. Available: https://www.sintef.no/projectweb/vectfit/downloads/vfit3/. [5] A. Zadehgol, "A semi-analytic and cellular approach to rational system characterization through equivalent circuits", Wiley IJNM, 2015. [Online]. https://doi.org/10.1002/jnm.2119 [6] V. Avula and A. Zadehgol, "A Novel Method for Equivalent Circuit Synthesis from Frequency Response of Multi-port Networks", EMC EUR, pp. 79-84, 2016. [Online]. Available: ://WOS:000392194100012. [7] B. Gustavsen, Matrix Fitting Toolbox, The Vector Fitting Website. March 20, 2013. Accessed on: Feb. 25, 2020. [Online]. Available: https://www.sintef.no/projectweb/vectorfitting/downloads/matrix-fitting-toolbox/. [8] B. Gustavsen, "Fast passivity enforcement for S-parameter models by perturbation of residue matrix eigenvalues", IEEE Trans. Advanced Packaging, vol. 33, no. 1, pp. 257-265, Feb. 2010. [9] B. Gustavsen, "Fast Passivity Enforcement for Pole-Residue Models by Perturbation of Residue Matrix Eigenvalues", IEEE Trans. Power Delivery, vol. 23, no. 4, pp. 2278-2285, Oct. 2008. [10] A. Semlyen, B. Gustavsen, "A Half-Size Singularity Test Matrix for Fast and Reliable Passivity Assessment of Rational Models," IEEE Trans. Power Delivery, vol. 24, no. 1, pp. 345-351, Jan. 2009. [11] E. Medina, A. Ramirez, J. Morales and K. Sheshyekani, "Passivity Enforcement of FDNEs via Perturbation of Singularity Test Matrix," in IEEE Transactions on Power Delivery, vol. 35, no. 4, pp. 1648-1655, Aug. 2020, doi: 10.1109/TPWRD.2019.2949216. [12] Houle, Jennifer, GitHub. May 10, 2020. Accessed on: February 3, 2021. [Online]. Available: https://github.com/jenniferEhoule/circuit_synthesis
48/100 healthpankaj614 /
India GDP Analysis Problem Description - I NITI Aayog: Background NITI Aayog (National Institution for Transforming India) is a policy think tank of the Government of India; it provides strategic inputs to the central and the state governments to achieve various development goals. In the past, NITI Aayog has played an important role in initiatives such as Digital India, Atal Innovation Mission and various agricultural reforms and have designed various policies in education, skill development, water management, healthcare, etc. NITI Aayog was established to replace the Planning Commission of India, which used to follow a top-down model for policy making, i.e., it typically designed policies at the central level (such as the 5-year plans). On the other hand, NITI Aayog designs policies specific to the different states or segments of the economy. Finance Minister, Arun Jaitley, made the following observation on the necessity of creating NITI Aayog, "The 65-year-old Planning Commission had become a redundant organisation. It was relevant in a command economy structure, but not any longer. India is a diversified country and its states are in various phases of economic development along with their own strengths and weaknesses. In this context, a ‘one size fits all’ approach to economic planning is obsolete...". Project Brief We are working as the chief data scientist at NITI Aayog, reporting to the CEO. The CEO has initiated a project wherein the NITI Aayog will provide top-level recommendations to the Chief Ministers (CMs) of various states, which will help them prioritise areas of development for their respective states. Since different states are in different phases of development, the recommendations should be specific to the states. The overall goal of this project is to help the CMs focus on areas that will foster economic development for their respective states. Since the most common measure of economic development is the GDP, we will analyse the GDP of the various states of India and suggest ways to improve it. Understanding GDP Gross domestic product (GDP) at current prices is the GDP at the market value of goods and services produced in a country during a year. In other words, GDP measures the 'monetary value of final goods and services produced by a country/state in a given period of time'. GDP can be broadly divided into goods and services produced by three sectors: the primary sector (agriculture), the secondary sector (industry), and the tertiary sector (services). It is also known as nominal GDP. More technically, (real) GDP takes into account the price change that may have occurred due to inflation. This means that the real GDP is nominal GDP adjusted for inflation. We will use the nominal GDP for this exercise. Also, we will consider the financial year 2015-16 as the base year, as most of the data required for this exercise is available for the aforementioned period. Per Capita GDP and Income Total GDP divided by the population gives the per capita GDP, which roughly measures the average value of goods and services produced per person. The per capita income is closely related to the per capita GDP (though they are not the same). In general, the per capita income increases when the per capita GDP increases, and vice-versa. For instance, in the financial year 2015-16, the per capita income of India was ₹93,293, whereas the per capita GDP of India was $1717, which roughly amounts to ₹1,11,605. Problem Description - II Data The data is sourced from https://data.gov.in/, an Open Government Data (OGD) platform of India. The download instructions are provided in the next segment. The data for GDP analysis of the Indian states is divided into two parts: Data I-A: This dataset consists of the GSDP (Gross State Domestic Product) data for the states and union territories. Data I-B: This dataset contains the distribution of GSDP among three sectors: the primary sector (agriculture), the secondary sector (industry) and the tertiary sector (services) along with taxes and subsidies. There is separate dataset for each of the states. We are expected to read the dataset for the available states and join these (in Python) if needed. There are two parts to this project. In the first part, we will analyse and compare the GDPs of various Indian states (both total and per capita). The GDP of a state is referred to as the GSDP (Gross State Domestic Product). Then, we will divide the states into four categories based on the GDP per capita, and for each of these four categories, we will analyse the sectors that contribute the most to the GDP (such as agriculture, real estate, manufacturing, etc.). In the second part, we will analyse whether GDP per capita is related to dropout rates in schools and colleges. Part-I: GDP Analysis of the Indian States For each of the following steps of analysis, choose an appropriate type of plot for comparing the data. Also, ensure that the plots are in increasing or decreasing order for better comparison. For example, if we make a bar plot to compare the GDPs of the states, ensure that the bars are in either increasing or decreasing order of GDP. Part I-A: For the analysis below, use the Data I-A. First, we need to load the data in Python properly and then clean it. This also involves the treatment of missing values, we can choose to drop the row or column as well. Remember this will affect our next analysis and results drastically. Plot a graph for rows " % Growth over previous year" for all the states (not union territories) whose data is available, use as much data as possible for this exercise. Use the best fit line to represent the growth for each state. Draw a similar line graph for the nation as well. How will we compare the growth rates of any two states? Which states have been growing consistently fast, and which ones have been struggling? Rank top 3 fastest and 3 slowest-growing states. What is the Nation's growth rate? What has been the growth rate of my home state, and how does it compare to the national growth rate? Plot the total GDP of the states for the year 2015-16: Which Plot will we use for this? Why? (Remeber to plot the graph in a way such as it is easier to read and compare) Identify the top 5 and the bottom 5 states based on total GDP. What insights can we draw from this graph? What states are performing poorly? (Remember: this will not be solely based on total GDP) Part I-B: For the analysis below, use Data I-B. We can also use Data I-B along with Data I-A if required. Also, perform the analysis only for the duration 2014-15. Filter out the union territories (Delhi, Chandigarh, Andaman and Nicobar Islands, etc.) for further analysis, as they are governed directly by the central, not state governments. Plot the GDP per capita for all the states. Identify the top 5 and the bottom 5 states based on the GDP per capita. Find the ratio of the highest per capita GDP to the lowest per capita GDP. Plot the percentage contribution of the primary, secondary and tertiary sectors as a percentage of the total GDP for all the states. Which plot will we use here? Why? Why is (Primary + Secondary + Tertiary) not equal to total GDP? Can we draw any insight from this? Find correlation of percentile of the state (% of states with lower per capita GDP) and %contribution of Primary sector to total GDP. Categorise the states into four groups based on the GDP per capita (C1, C2, C3, C4, where C1 would have the highest per capita GDP and C4, the lowest). The quantile values are (0.20,0.5, 0.85, 1), i.e., the states lying between the 85th and the 100th percentile are in C1; those between the 50th and the 85th percentiles are in C2, and so on. Note: Categorisation into four groups will simplify the subsequent analysis, as otherwise, comparing the data of all the states would become quite exhaustive. For each category (C1, C2, C3, C4): Find the top 3/4/5 sub-sectors (such as agriculture, forestry and fishing, crops, manufacturing etc., not primary, secondary and tertiary) that contribute to approximately 80% of the GSDP of each category. Note-I: The nomenclature for this project is as follows: primary, secondary and tertiary are named 'sectors', while agriculture, manufacturing etc. are named 'sub-sectors'. Note-II: If the top 3 sub-sectors contribute to, say, 79% of the GDP of some category, we can report "These top 3 sub-sectors contribute to approximately 80% of the GDP". This is to simplify the analysis and make the results consumable. (Remember, the CEO has to present the report to the CMs, and CMs have limited time; so, the analysis needs to be sharp and concise.) Plot the contribution of the sub-sectors as a percentage of the GSDP of each category. Now that we have summarised the data in the form of plots, tables, etc., try to draw non-obvious insights from it. Think about questions such as: How does the GDP distribution of the top states (C1) differ from the others? Which sub-sectors seem to be correlated with high GDP? Which sub-sectors do the various categories need to focus on? Ask other such relevant questions, which we think are important, and note we insights for category separately. More insights are welcome and will be awarded accordingly. Finally, provide at least two recommendations for each category to improve the per capita GDP. Part-II: GDP and Education Dropout Rates In Part-I, we would have noticed that (one) way to increase per capita GDP is by shifting the distribution of GDP towards the secondary and tertiary sectors, i.e., the manufacturing and services industries. But these industries can thrive only when there is an availability of educated and skilled labour. In this part of the analysis, we will investigate whether there is any relationship between per capita GDP with dropout rates in education. Data Data II: This section will require the dropout rate dataset apart from the dataset that we used in Part-1 of the case study. Download instructions are provided in the next segment. Part-II: GDP and Education Analyse if there is any correlation of GDP per capita with dropout rates in education (primary, upper primary and secondary) for the year 2014-2015 for each state. Choose an appropriate plot to conduct this analysis. Is there any correlation between dropout rate and %contribution of each sector (Primary, Secondary and Tertiary) to the total GDP? We have the total population of each state from the data in part I. Is there any correlation between dropout rates and population? What is the expected trend and what is the observation? Write down the key insights we draw from this data: Form at least one reasonable hypothesis for the observations from the data About GDP analysis for India in the year for 2015-16 and recommendation for the individual states for increasing the GDP by focusing on various factor. Topics python statistical-analysis data-analysis gdp-analysis Resources Readme Stars 0 stars Watchers 1 watching Forks 0 forks Releases No releases published Packages No packages published Languages Jupyter Notebook 100.0% Footer © 2022 GitHub, Inc. Footer navigation Terms Privacy Security Status Docs Contact GitHub Pricing API Training Blog About
25/100 healthudityamerit /
This Python package provides a robust framework to automatically train, evaluate, and visualize multiple machine learning models for both Classification and Regression problems. It includes features for automatic best model recommendation, colorful confusion matrices, and comprehensive performance plots.
76/100 health