This article explains various ways to create dummy or random data in Python for practice. Like R, we can create dummy data frames using pandas and numpy packages. Most of the analysts prepare data in MS Excel. Later they import it into Python to hone their data wrangling skills in Python. This is not an efficient approach. The efficient approach is to prepare random data in Python and use it later for data manipulation.
1. Enter Data Manually in Editor Window
The first step is to load pandas package and use
(continued...)1. Enter Data Manually in Editor Window
The first step is to load pandas package and use
DataFrame
functionimport pandas as pd
data = pd.DataFrame({"A" : ["John","Deep","Julia","Kate","Sandy"],
"MonthSales" : [25,30,35,40,45]})
A MonthSales
0 John 25
1 Deep 30
2 Julia
from Planet SciPy
read more
No comments:
Post a Comment